rapidata 2.41.3__py3-none-any.whl → 2.42.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

Files changed (74) hide show
  1. rapidata/__init__.py +1 -5
  2. rapidata/api_client/__init__.py +14 -14
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/asset_api.py +851 -0
  5. rapidata/api_client/api/benchmark_api.py +298 -0
  6. rapidata/api_client/api/customer_rapid_api.py +29 -43
  7. rapidata/api_client/api/dataset_api.py +163 -1143
  8. rapidata/api_client/api/participant_api.py +28 -74
  9. rapidata/api_client/api/validation_set_api.py +283 -0
  10. rapidata/api_client/models/__init__.py +13 -14
  11. rapidata/api_client/models/add_validation_rapid_model.py +3 -3
  12. rapidata/api_client/models/add_validation_rapid_new_model.py +152 -0
  13. rapidata/api_client/models/add_validation_rapid_new_model_asset.py +182 -0
  14. rapidata/api_client/models/compare_workflow_model.py +3 -3
  15. rapidata/api_client/models/create_datapoint_from_files_model.py +3 -3
  16. rapidata/api_client/models/create_datapoint_from_text_sources_model.py +3 -3
  17. rapidata/api_client/models/create_datapoint_from_urls_model.py +3 -3
  18. rapidata/api_client/models/create_datapoint_model.py +108 -0
  19. rapidata/api_client/models/create_datapoint_model_asset.py +182 -0
  20. rapidata/api_client/models/create_demographic_rapid_model.py +13 -2
  21. rapidata/api_client/models/create_demographic_rapid_model_asset.py +188 -0
  22. rapidata/api_client/models/create_demographic_rapid_model_new.py +119 -0
  23. rapidata/api_client/models/create_sample_model.py +8 -2
  24. rapidata/api_client/models/create_sample_model_asset.py +182 -0
  25. rapidata/api_client/models/create_sample_model_obsolete.py +87 -0
  26. rapidata/api_client/models/file_asset_input_file.py +8 -22
  27. rapidata/api_client/models/fork_benchmark_result.py +87 -0
  28. rapidata/api_client/models/form_file_wrapper.py +17 -2
  29. rapidata/api_client/models/get_asset_metadata_result.py +100 -0
  30. rapidata/api_client/models/multi_asset_input_assets_inner.py +10 -24
  31. rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
  32. rapidata/api_client/models/proxy_file_wrapper.py +17 -2
  33. rapidata/api_client/models/stream_file_wrapper.py +25 -3
  34. rapidata/api_client/models/submit_prompt_model.py +3 -3
  35. rapidata/api_client/models/text_metadata.py +6 -1
  36. rapidata/api_client/models/text_metadata_model.py +7 -2
  37. rapidata/api_client/models/upload_file_from_url_result.py +87 -0
  38. rapidata/api_client/models/upload_file_result.py +87 -0
  39. rapidata/api_client/models/zip_entry_file_wrapper.py +33 -2
  40. rapidata/api_client_README.md +28 -25
  41. rapidata/rapidata_client/__init__.py +0 -1
  42. rapidata/rapidata_client/benchmark/participant/_participant.py +25 -24
  43. rapidata/rapidata_client/benchmark/rapidata_benchmark.py +89 -102
  44. rapidata/rapidata_client/datapoints/__init__.py +0 -1
  45. rapidata/rapidata_client/datapoints/_asset_uploader.py +71 -0
  46. rapidata/rapidata_client/datapoints/_datapoint.py +58 -171
  47. rapidata/rapidata_client/datapoints/_datapoint_uploader.py +95 -0
  48. rapidata/rapidata_client/datapoints/assets/__init__.py +0 -11
  49. rapidata/rapidata_client/datapoints/metadata/_media_asset_metadata.py +10 -7
  50. rapidata/rapidata_client/demographic/demographic_manager.py +21 -8
  51. rapidata/rapidata_client/exceptions/failed_upload_exception.py +0 -62
  52. rapidata/rapidata_client/order/_rapidata_order_builder.py +0 -10
  53. rapidata/rapidata_client/order/dataset/_rapidata_dataset.py +65 -187
  54. rapidata/rapidata_client/order/rapidata_order_manager.py +62 -124
  55. rapidata/rapidata_client/validation/rapidata_validation_set.py +9 -5
  56. rapidata/rapidata_client/validation/rapids/_validation_rapid_uploader.py +101 -0
  57. rapidata/rapidata_client/validation/rapids/box.py +35 -11
  58. rapidata/rapidata_client/validation/rapids/rapids.py +26 -128
  59. rapidata/rapidata_client/validation/rapids/rapids_manager.py +123 -104
  60. rapidata/rapidata_client/validation/validation_set_manager.py +41 -38
  61. rapidata/rapidata_client/workflow/_ranking_workflow.py +14 -17
  62. rapidata/rapidata_client/workflow/_select_words_workflow.py +3 -16
  63. rapidata/service/openapi_service.py +8 -3
  64. {rapidata-2.41.3.dist-info → rapidata-2.42.1.dist-info}/METADATA +1 -1
  65. {rapidata-2.41.3.dist-info → rapidata-2.42.1.dist-info}/RECORD +67 -58
  66. {rapidata-2.41.3.dist-info → rapidata-2.42.1.dist-info}/WHEEL +1 -1
  67. rapidata/rapidata_client/datapoints/assets/_base_asset.py +0 -13
  68. rapidata/rapidata_client/datapoints/assets/_media_asset.py +0 -318
  69. rapidata/rapidata_client/datapoints/assets/_multi_asset.py +0 -61
  70. rapidata/rapidata_client/datapoints/assets/_sessions.py +0 -40
  71. rapidata/rapidata_client/datapoints/assets/_text_asset.py +0 -34
  72. rapidata/rapidata_client/datapoints/assets/data_type_enum.py +0 -8
  73. rapidata/rapidata_client/order/dataset/_progress_tracker.py +0 -100
  74. {rapidata-2.41.3.dist-info → rapidata-2.42.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,851 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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, StrictBytes, StrictStr
20
+ from typing import Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from rapidata.api_client.models.get_asset_metadata_result import GetAssetMetadataResult
23
+ from rapidata.api_client.models.upload_file_from_url_result import UploadFileFromUrlResult
24
+ from rapidata.api_client.models.upload_file_result import UploadFileResult
25
+
26
+ from rapidata.api_client.api_client import ApiClient, RequestSerialized
27
+ from rapidata.api_client.api_response import ApiResponse
28
+ from rapidata.api_client.rest import RESTResponseType
29
+
30
+
31
+ class AssetApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ def asset_file_name_metadata_get(
46
+ self,
47
+ file_name: Annotated[StrictStr, Field(description="The name of the file to retrieve metadata for.")],
48
+ _request_timeout: Union[
49
+ None,
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Tuple[
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Annotated[StrictFloat, Field(gt=0)]
54
+ ]
55
+ ] = None,
56
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
57
+ _content_type: Optional[StrictStr] = None,
58
+ _headers: Optional[Dict[StrictStr, Any]] = None,
59
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
60
+ ) -> GetAssetMetadataResult:
61
+ """Gets the metadata for an asset by file name.
62
+
63
+ This endpoint retrieves metadata information for an asset stored in S3. The metadata includes details such as content type, size, creation date, and custom metadata fields.
64
+
65
+ :param file_name: The name of the file to retrieve metadata for. (required)
66
+ :type file_name: str
67
+ :param _request_timeout: timeout setting for this request. If one
68
+ number provided, it will be total request
69
+ timeout. It can also be a pair (tuple) of
70
+ (connection, read) timeouts.
71
+ :type _request_timeout: int, tuple(int, int), optional
72
+ :param _request_auth: set to override the auth_settings for an a single
73
+ request; this effectively ignores the
74
+ authentication in the spec for a single request.
75
+ :type _request_auth: dict, optional
76
+ :param _content_type: force content-type for the request.
77
+ :type _content_type: str, Optional
78
+ :param _headers: set to override the headers for a single
79
+ request; this effectively ignores the headers
80
+ in the spec for a single request.
81
+ :type _headers: dict, optional
82
+ :param _host_index: set to override the host_index for a single
83
+ request; this effectively ignores the host_index
84
+ in the spec for a single request.
85
+ :type _host_index: int, optional
86
+ :return: Returns the result object.
87
+ """ # noqa: E501
88
+
89
+ _param = self._asset_file_name_metadata_get_serialize(
90
+ file_name=file_name,
91
+ _request_auth=_request_auth,
92
+ _content_type=_content_type,
93
+ _headers=_headers,
94
+ _host_index=_host_index
95
+ )
96
+
97
+ _response_types_map: Dict[str, Optional[str]] = {
98
+ '200': "GetAssetMetadataResult",
99
+ '404': "ProblemDetails",
100
+ }
101
+ response_data = self.api_client.call_api(
102
+ *_param,
103
+ _request_timeout=_request_timeout
104
+ )
105
+ response_data.read()
106
+ return self.api_client.response_deserialize(
107
+ response_data=response_data,
108
+ response_types_map=_response_types_map,
109
+ ).data
110
+
111
+
112
+ @validate_call
113
+ def asset_file_name_metadata_get_with_http_info(
114
+ self,
115
+ file_name: Annotated[StrictStr, Field(description="The name of the file to retrieve metadata for.")],
116
+ _request_timeout: Union[
117
+ None,
118
+ Annotated[StrictFloat, Field(gt=0)],
119
+ Tuple[
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Annotated[StrictFloat, Field(gt=0)]
122
+ ]
123
+ ] = None,
124
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
125
+ _content_type: Optional[StrictStr] = None,
126
+ _headers: Optional[Dict[StrictStr, Any]] = None,
127
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
128
+ ) -> ApiResponse[GetAssetMetadataResult]:
129
+ """Gets the metadata for an asset by file name.
130
+
131
+ This endpoint retrieves metadata information for an asset stored in S3. The metadata includes details such as content type, size, creation date, and custom metadata fields.
132
+
133
+ :param file_name: The name of the file to retrieve metadata for. (required)
134
+ :type file_name: str
135
+ :param _request_timeout: timeout setting for this request. If one
136
+ number provided, it will be total request
137
+ timeout. It can also be a pair (tuple) of
138
+ (connection, read) timeouts.
139
+ :type _request_timeout: int, tuple(int, int), optional
140
+ :param _request_auth: set to override the auth_settings for an a single
141
+ request; this effectively ignores the
142
+ authentication in the spec for a single request.
143
+ :type _request_auth: dict, optional
144
+ :param _content_type: force content-type for the request.
145
+ :type _content_type: str, Optional
146
+ :param _headers: set to override the headers for a single
147
+ request; this effectively ignores the headers
148
+ in the spec for a single request.
149
+ :type _headers: dict, optional
150
+ :param _host_index: set to override the host_index for a single
151
+ request; this effectively ignores the host_index
152
+ in the spec for a single request.
153
+ :type _host_index: int, optional
154
+ :return: Returns the result object.
155
+ """ # noqa: E501
156
+
157
+ _param = self._asset_file_name_metadata_get_serialize(
158
+ file_name=file_name,
159
+ _request_auth=_request_auth,
160
+ _content_type=_content_type,
161
+ _headers=_headers,
162
+ _host_index=_host_index
163
+ )
164
+
165
+ _response_types_map: Dict[str, Optional[str]] = {
166
+ '200': "GetAssetMetadataResult",
167
+ '404': "ProblemDetails",
168
+ }
169
+ response_data = self.api_client.call_api(
170
+ *_param,
171
+ _request_timeout=_request_timeout
172
+ )
173
+ response_data.read()
174
+ return self.api_client.response_deserialize(
175
+ response_data=response_data,
176
+ response_types_map=_response_types_map,
177
+ )
178
+
179
+
180
+ @validate_call
181
+ def asset_file_name_metadata_get_without_preload_content(
182
+ self,
183
+ file_name: Annotated[StrictStr, Field(description="The name of the file to retrieve metadata for.")],
184
+ _request_timeout: Union[
185
+ None,
186
+ Annotated[StrictFloat, Field(gt=0)],
187
+ Tuple[
188
+ Annotated[StrictFloat, Field(gt=0)],
189
+ Annotated[StrictFloat, Field(gt=0)]
190
+ ]
191
+ ] = None,
192
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
193
+ _content_type: Optional[StrictStr] = None,
194
+ _headers: Optional[Dict[StrictStr, Any]] = None,
195
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
196
+ ) -> RESTResponseType:
197
+ """Gets the metadata for an asset by file name.
198
+
199
+ This endpoint retrieves metadata information for an asset stored in S3. The metadata includes details such as content type, size, creation date, and custom metadata fields.
200
+
201
+ :param file_name: The name of the file to retrieve metadata for. (required)
202
+ :type file_name: str
203
+ :param _request_timeout: timeout setting for this request. If one
204
+ number provided, it will be total request
205
+ timeout. It can also be a pair (tuple) of
206
+ (connection, read) timeouts.
207
+ :type _request_timeout: int, tuple(int, int), optional
208
+ :param _request_auth: set to override the auth_settings for an a single
209
+ request; this effectively ignores the
210
+ authentication in the spec for a single request.
211
+ :type _request_auth: dict, optional
212
+ :param _content_type: force content-type for the request.
213
+ :type _content_type: str, Optional
214
+ :param _headers: set to override the headers for a single
215
+ request; this effectively ignores the headers
216
+ in the spec for a single request.
217
+ :type _headers: dict, optional
218
+ :param _host_index: set to override the host_index for a single
219
+ request; this effectively ignores the host_index
220
+ in the spec for a single request.
221
+ :type _host_index: int, optional
222
+ :return: Returns the result object.
223
+ """ # noqa: E501
224
+
225
+ _param = self._asset_file_name_metadata_get_serialize(
226
+ file_name=file_name,
227
+ _request_auth=_request_auth,
228
+ _content_type=_content_type,
229
+ _headers=_headers,
230
+ _host_index=_host_index
231
+ )
232
+
233
+ _response_types_map: Dict[str, Optional[str]] = {
234
+ '200': "GetAssetMetadataResult",
235
+ '404': "ProblemDetails",
236
+ }
237
+ response_data = self.api_client.call_api(
238
+ *_param,
239
+ _request_timeout=_request_timeout
240
+ )
241
+ return response_data.response
242
+
243
+
244
+ def _asset_file_name_metadata_get_serialize(
245
+ self,
246
+ file_name,
247
+ _request_auth,
248
+ _content_type,
249
+ _headers,
250
+ _host_index,
251
+ ) -> RequestSerialized:
252
+
253
+ _host = None
254
+
255
+ _collection_formats: Dict[str, str] = {
256
+ }
257
+
258
+ _path_params: Dict[str, str] = {}
259
+ _query_params: List[Tuple[str, str]] = []
260
+ _header_params: Dict[str, Optional[str]] = _headers or {}
261
+ _form_params: List[Tuple[str, str]] = []
262
+ _files: Dict[
263
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
264
+ ] = {}
265
+ _body_params: Optional[bytes] = None
266
+
267
+ # process the path parameters
268
+ if file_name is not None:
269
+ _path_params['fileName'] = file_name
270
+ # process the query parameters
271
+ # process the header parameters
272
+ # process the form parameters
273
+ # process the body parameter
274
+
275
+
276
+ # set the HTTP header `Accept`
277
+ if 'Accept' not in _header_params:
278
+ _header_params['Accept'] = self.api_client.select_header_accept(
279
+ [
280
+ 'text/plain',
281
+ 'application/json',
282
+ 'text/json'
283
+ ]
284
+ )
285
+
286
+
287
+ # authentication setting
288
+ _auth_settings: List[str] = [
289
+ 'bearer',
290
+ 'oauth2'
291
+ ]
292
+
293
+ return self.api_client.param_serialize(
294
+ method='GET',
295
+ resource_path='/asset/{fileName}/metadata',
296
+ path_params=_path_params,
297
+ query_params=_query_params,
298
+ header_params=_header_params,
299
+ body=_body_params,
300
+ post_params=_form_params,
301
+ files=_files,
302
+ auth_settings=_auth_settings,
303
+ collection_formats=_collection_formats,
304
+ _host=_host,
305
+ _request_auth=_request_auth
306
+ )
307
+
308
+
309
+
310
+
311
+ @validate_call
312
+ def asset_file_post(
313
+ self,
314
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The file to upload to S3.")] = None,
315
+ _request_timeout: Union[
316
+ None,
317
+ Annotated[StrictFloat, Field(gt=0)],
318
+ Tuple[
319
+ Annotated[StrictFloat, Field(gt=0)],
320
+ Annotated[StrictFloat, Field(gt=0)]
321
+ ]
322
+ ] = None,
323
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
324
+ _content_type: Optional[StrictStr] = None,
325
+ _headers: Optional[Dict[StrictStr, Any]] = None,
326
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
327
+ ) -> UploadFileResult:
328
+ """Uploads a single asset to S3 and returns the asset details.
329
+
330
+ This endpoint allows uploading a single file to S3 storage with the asset creator. The uploaded asset will be stored using the configured S3 settings and a unique filename will be generated.
331
+
332
+ :param file: The file to upload to S3.
333
+ :type file: bytearray
334
+ :param _request_timeout: timeout setting for this request. If one
335
+ number provided, it will be total request
336
+ timeout. It can also be a pair (tuple) of
337
+ (connection, read) timeouts.
338
+ :type _request_timeout: int, tuple(int, int), optional
339
+ :param _request_auth: set to override the auth_settings for an a single
340
+ request; this effectively ignores the
341
+ authentication in the spec for a single request.
342
+ :type _request_auth: dict, optional
343
+ :param _content_type: force content-type for the request.
344
+ :type _content_type: str, Optional
345
+ :param _headers: set to override the headers for a single
346
+ request; this effectively ignores the headers
347
+ in the spec for a single request.
348
+ :type _headers: dict, optional
349
+ :param _host_index: set to override the host_index for a single
350
+ request; this effectively ignores the host_index
351
+ in the spec for a single request.
352
+ :type _host_index: int, optional
353
+ :return: Returns the result object.
354
+ """ # noqa: E501
355
+
356
+ _param = self._asset_file_post_serialize(
357
+ file=file,
358
+ _request_auth=_request_auth,
359
+ _content_type=_content_type,
360
+ _headers=_headers,
361
+ _host_index=_host_index
362
+ )
363
+
364
+ _response_types_map: Dict[str, Optional[str]] = {
365
+ '200': "UploadFileResult",
366
+ }
367
+ response_data = self.api_client.call_api(
368
+ *_param,
369
+ _request_timeout=_request_timeout
370
+ )
371
+ response_data.read()
372
+ return self.api_client.response_deserialize(
373
+ response_data=response_data,
374
+ response_types_map=_response_types_map,
375
+ ).data
376
+
377
+
378
+ @validate_call
379
+ def asset_file_post_with_http_info(
380
+ self,
381
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The file to upload to S3.")] = None,
382
+ _request_timeout: Union[
383
+ None,
384
+ Annotated[StrictFloat, Field(gt=0)],
385
+ Tuple[
386
+ Annotated[StrictFloat, Field(gt=0)],
387
+ Annotated[StrictFloat, Field(gt=0)]
388
+ ]
389
+ ] = None,
390
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
391
+ _content_type: Optional[StrictStr] = None,
392
+ _headers: Optional[Dict[StrictStr, Any]] = None,
393
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
394
+ ) -> ApiResponse[UploadFileResult]:
395
+ """Uploads a single asset to S3 and returns the asset details.
396
+
397
+ This endpoint allows uploading a single file to S3 storage with the asset creator. The uploaded asset will be stored using the configured S3 settings and a unique filename will be generated.
398
+
399
+ :param file: The file to upload to S3.
400
+ :type file: bytearray
401
+ :param _request_timeout: timeout setting for this request. If one
402
+ number provided, it will be total request
403
+ timeout. It can also be a pair (tuple) of
404
+ (connection, read) timeouts.
405
+ :type _request_timeout: int, tuple(int, int), optional
406
+ :param _request_auth: set to override the auth_settings for an a single
407
+ request; this effectively ignores the
408
+ authentication in the spec for a single request.
409
+ :type _request_auth: dict, optional
410
+ :param _content_type: force content-type for the request.
411
+ :type _content_type: str, Optional
412
+ :param _headers: set to override the headers for a single
413
+ request; this effectively ignores the headers
414
+ in the spec for a single request.
415
+ :type _headers: dict, optional
416
+ :param _host_index: set to override the host_index for a single
417
+ request; this effectively ignores the host_index
418
+ in the spec for a single request.
419
+ :type _host_index: int, optional
420
+ :return: Returns the result object.
421
+ """ # noqa: E501
422
+
423
+ _param = self._asset_file_post_serialize(
424
+ file=file,
425
+ _request_auth=_request_auth,
426
+ _content_type=_content_type,
427
+ _headers=_headers,
428
+ _host_index=_host_index
429
+ )
430
+
431
+ _response_types_map: Dict[str, Optional[str]] = {
432
+ '200': "UploadFileResult",
433
+ }
434
+ response_data = self.api_client.call_api(
435
+ *_param,
436
+ _request_timeout=_request_timeout
437
+ )
438
+ response_data.read()
439
+ return self.api_client.response_deserialize(
440
+ response_data=response_data,
441
+ response_types_map=_response_types_map,
442
+ )
443
+
444
+
445
+ @validate_call
446
+ def asset_file_post_without_preload_content(
447
+ self,
448
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The file to upload to S3.")] = None,
449
+ _request_timeout: Union[
450
+ None,
451
+ Annotated[StrictFloat, Field(gt=0)],
452
+ Tuple[
453
+ Annotated[StrictFloat, Field(gt=0)],
454
+ Annotated[StrictFloat, Field(gt=0)]
455
+ ]
456
+ ] = None,
457
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
458
+ _content_type: Optional[StrictStr] = None,
459
+ _headers: Optional[Dict[StrictStr, Any]] = None,
460
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
461
+ ) -> RESTResponseType:
462
+ """Uploads a single asset to S3 and returns the asset details.
463
+
464
+ This endpoint allows uploading a single file to S3 storage with the asset creator. The uploaded asset will be stored using the configured S3 settings and a unique filename will be generated.
465
+
466
+ :param file: The file to upload to S3.
467
+ :type file: bytearray
468
+ :param _request_timeout: timeout setting for this request. If one
469
+ number provided, it will be total request
470
+ timeout. It can also be a pair (tuple) of
471
+ (connection, read) timeouts.
472
+ :type _request_timeout: int, tuple(int, int), optional
473
+ :param _request_auth: set to override the auth_settings for an a single
474
+ request; this effectively ignores the
475
+ authentication in the spec for a single request.
476
+ :type _request_auth: dict, optional
477
+ :param _content_type: force content-type for the request.
478
+ :type _content_type: str, Optional
479
+ :param _headers: set to override the headers for a single
480
+ request; this effectively ignores the headers
481
+ in the spec for a single request.
482
+ :type _headers: dict, optional
483
+ :param _host_index: set to override the host_index for a single
484
+ request; this effectively ignores the host_index
485
+ in the spec for a single request.
486
+ :type _host_index: int, optional
487
+ :return: Returns the result object.
488
+ """ # noqa: E501
489
+
490
+ _param = self._asset_file_post_serialize(
491
+ file=file,
492
+ _request_auth=_request_auth,
493
+ _content_type=_content_type,
494
+ _headers=_headers,
495
+ _host_index=_host_index
496
+ )
497
+
498
+ _response_types_map: Dict[str, Optional[str]] = {
499
+ '200': "UploadFileResult",
500
+ }
501
+ response_data = self.api_client.call_api(
502
+ *_param,
503
+ _request_timeout=_request_timeout
504
+ )
505
+ return response_data.response
506
+
507
+
508
+ def _asset_file_post_serialize(
509
+ self,
510
+ file,
511
+ _request_auth,
512
+ _content_type,
513
+ _headers,
514
+ _host_index,
515
+ ) -> RequestSerialized:
516
+
517
+ _host = None
518
+
519
+ _collection_formats: Dict[str, str] = {
520
+ }
521
+
522
+ _path_params: Dict[str, str] = {}
523
+ _query_params: List[Tuple[str, str]] = []
524
+ _header_params: Dict[str, Optional[str]] = _headers or {}
525
+ _form_params: List[Tuple[str, str]] = []
526
+ _files: Dict[
527
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
528
+ ] = {}
529
+ _body_params: Optional[bytes] = None
530
+
531
+ # process the path parameters
532
+ # process the query parameters
533
+ # process the header parameters
534
+ # process the form parameters
535
+ if file is not None:
536
+ _files['file'] = file
537
+ # process the body parameter
538
+
539
+
540
+ # set the HTTP header `Accept`
541
+ if 'Accept' not in _header_params:
542
+ _header_params['Accept'] = self.api_client.select_header_accept(
543
+ [
544
+ 'text/plain',
545
+ 'application/json',
546
+ 'text/json'
547
+ ]
548
+ )
549
+
550
+ # set the HTTP header `Content-Type`
551
+ if _content_type:
552
+ _header_params['Content-Type'] = _content_type
553
+ else:
554
+ _default_content_type = (
555
+ self.api_client.select_header_content_type(
556
+ [
557
+ 'multipart/form-data'
558
+ ]
559
+ )
560
+ )
561
+ if _default_content_type is not None:
562
+ _header_params['Content-Type'] = _default_content_type
563
+
564
+ # authentication setting
565
+ _auth_settings: List[str] = [
566
+ 'bearer',
567
+ 'oauth2'
568
+ ]
569
+
570
+ return self.api_client.param_serialize(
571
+ method='POST',
572
+ resource_path='/asset/file',
573
+ path_params=_path_params,
574
+ query_params=_query_params,
575
+ header_params=_header_params,
576
+ body=_body_params,
577
+ post_params=_form_params,
578
+ files=_files,
579
+ auth_settings=_auth_settings,
580
+ collection_formats=_collection_formats,
581
+ _host=_host,
582
+ _request_auth=_request_auth
583
+ )
584
+
585
+
586
+
587
+
588
+ @validate_call
589
+ def asset_url_post(
590
+ self,
591
+ url: Annotated[Optional[StrictStr], Field(description="The url of the file to upload to S3.")] = None,
592
+ _request_timeout: Union[
593
+ None,
594
+ Annotated[StrictFloat, Field(gt=0)],
595
+ Tuple[
596
+ Annotated[StrictFloat, Field(gt=0)],
597
+ Annotated[StrictFloat, Field(gt=0)]
598
+ ]
599
+ ] = None,
600
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
601
+ _content_type: Optional[StrictStr] = None,
602
+ _headers: Optional[Dict[StrictStr, Any]] = None,
603
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
604
+ ) -> UploadFileFromUrlResult:
605
+ """Uploads a single asset to S3 and returns the asset details.
606
+
607
+ This endpoint allows uploading a single file to S3 storage with the asset creator. The uploaded asset will be stored using the configured S3 settings and a unique filename will be generated.
608
+
609
+ :param url: The url of the file to upload to S3.
610
+ :type url: str
611
+ :param _request_timeout: timeout setting for this request. If one
612
+ number provided, it will be total request
613
+ timeout. It can also be a pair (tuple) of
614
+ (connection, read) timeouts.
615
+ :type _request_timeout: int, tuple(int, int), optional
616
+ :param _request_auth: set to override the auth_settings for an a single
617
+ request; this effectively ignores the
618
+ authentication in the spec for a single request.
619
+ :type _request_auth: dict, optional
620
+ :param _content_type: force content-type for the request.
621
+ :type _content_type: str, Optional
622
+ :param _headers: set to override the headers for a single
623
+ request; this effectively ignores the headers
624
+ in the spec for a single request.
625
+ :type _headers: dict, optional
626
+ :param _host_index: set to override the host_index for a single
627
+ request; this effectively ignores the host_index
628
+ in the spec for a single request.
629
+ :type _host_index: int, optional
630
+ :return: Returns the result object.
631
+ """ # noqa: E501
632
+
633
+ _param = self._asset_url_post_serialize(
634
+ url=url,
635
+ _request_auth=_request_auth,
636
+ _content_type=_content_type,
637
+ _headers=_headers,
638
+ _host_index=_host_index
639
+ )
640
+
641
+ _response_types_map: Dict[str, Optional[str]] = {
642
+ '200': "UploadFileFromUrlResult",
643
+ }
644
+ response_data = self.api_client.call_api(
645
+ *_param,
646
+ _request_timeout=_request_timeout
647
+ )
648
+ response_data.read()
649
+ return self.api_client.response_deserialize(
650
+ response_data=response_data,
651
+ response_types_map=_response_types_map,
652
+ ).data
653
+
654
+
655
+ @validate_call
656
+ def asset_url_post_with_http_info(
657
+ self,
658
+ url: Annotated[Optional[StrictStr], Field(description="The url of the file to upload to S3.")] = None,
659
+ _request_timeout: Union[
660
+ None,
661
+ Annotated[StrictFloat, Field(gt=0)],
662
+ Tuple[
663
+ Annotated[StrictFloat, Field(gt=0)],
664
+ Annotated[StrictFloat, Field(gt=0)]
665
+ ]
666
+ ] = None,
667
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
668
+ _content_type: Optional[StrictStr] = None,
669
+ _headers: Optional[Dict[StrictStr, Any]] = None,
670
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
671
+ ) -> ApiResponse[UploadFileFromUrlResult]:
672
+ """Uploads a single asset to S3 and returns the asset details.
673
+
674
+ This endpoint allows uploading a single file to S3 storage with the asset creator. The uploaded asset will be stored using the configured S3 settings and a unique filename will be generated.
675
+
676
+ :param url: The url of the file to upload to S3.
677
+ :type url: str
678
+ :param _request_timeout: timeout setting for this request. If one
679
+ number provided, it will be total request
680
+ timeout. It can also be a pair (tuple) of
681
+ (connection, read) timeouts.
682
+ :type _request_timeout: int, tuple(int, int), optional
683
+ :param _request_auth: set to override the auth_settings for an a single
684
+ request; this effectively ignores the
685
+ authentication in the spec for a single request.
686
+ :type _request_auth: dict, optional
687
+ :param _content_type: force content-type for the request.
688
+ :type _content_type: str, Optional
689
+ :param _headers: set to override the headers for a single
690
+ request; this effectively ignores the headers
691
+ in the spec for a single request.
692
+ :type _headers: dict, optional
693
+ :param _host_index: set to override the host_index for a single
694
+ request; this effectively ignores the host_index
695
+ in the spec for a single request.
696
+ :type _host_index: int, optional
697
+ :return: Returns the result object.
698
+ """ # noqa: E501
699
+
700
+ _param = self._asset_url_post_serialize(
701
+ url=url,
702
+ _request_auth=_request_auth,
703
+ _content_type=_content_type,
704
+ _headers=_headers,
705
+ _host_index=_host_index
706
+ )
707
+
708
+ _response_types_map: Dict[str, Optional[str]] = {
709
+ '200': "UploadFileFromUrlResult",
710
+ }
711
+ response_data = self.api_client.call_api(
712
+ *_param,
713
+ _request_timeout=_request_timeout
714
+ )
715
+ response_data.read()
716
+ return self.api_client.response_deserialize(
717
+ response_data=response_data,
718
+ response_types_map=_response_types_map,
719
+ )
720
+
721
+
722
+ @validate_call
723
+ def asset_url_post_without_preload_content(
724
+ self,
725
+ url: Annotated[Optional[StrictStr], Field(description="The url of the file to upload to S3.")] = None,
726
+ _request_timeout: Union[
727
+ None,
728
+ Annotated[StrictFloat, Field(gt=0)],
729
+ Tuple[
730
+ Annotated[StrictFloat, Field(gt=0)],
731
+ Annotated[StrictFloat, Field(gt=0)]
732
+ ]
733
+ ] = None,
734
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
735
+ _content_type: Optional[StrictStr] = None,
736
+ _headers: Optional[Dict[StrictStr, Any]] = None,
737
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
738
+ ) -> RESTResponseType:
739
+ """Uploads a single asset to S3 and returns the asset details.
740
+
741
+ This endpoint allows uploading a single file to S3 storage with the asset creator. The uploaded asset will be stored using the configured S3 settings and a unique filename will be generated.
742
+
743
+ :param url: The url of the file to upload to S3.
744
+ :type url: str
745
+ :param _request_timeout: timeout setting for this request. If one
746
+ number provided, it will be total request
747
+ timeout. It can also be a pair (tuple) of
748
+ (connection, read) timeouts.
749
+ :type _request_timeout: int, tuple(int, int), optional
750
+ :param _request_auth: set to override the auth_settings for an a single
751
+ request; this effectively ignores the
752
+ authentication in the spec for a single request.
753
+ :type _request_auth: dict, optional
754
+ :param _content_type: force content-type for the request.
755
+ :type _content_type: str, Optional
756
+ :param _headers: set to override the headers for a single
757
+ request; this effectively ignores the headers
758
+ in the spec for a single request.
759
+ :type _headers: dict, optional
760
+ :param _host_index: set to override the host_index for a single
761
+ request; this effectively ignores the host_index
762
+ in the spec for a single request.
763
+ :type _host_index: int, optional
764
+ :return: Returns the result object.
765
+ """ # noqa: E501
766
+
767
+ _param = self._asset_url_post_serialize(
768
+ url=url,
769
+ _request_auth=_request_auth,
770
+ _content_type=_content_type,
771
+ _headers=_headers,
772
+ _host_index=_host_index
773
+ )
774
+
775
+ _response_types_map: Dict[str, Optional[str]] = {
776
+ '200': "UploadFileFromUrlResult",
777
+ }
778
+ response_data = self.api_client.call_api(
779
+ *_param,
780
+ _request_timeout=_request_timeout
781
+ )
782
+ return response_data.response
783
+
784
+
785
+ def _asset_url_post_serialize(
786
+ self,
787
+ url,
788
+ _request_auth,
789
+ _content_type,
790
+ _headers,
791
+ _host_index,
792
+ ) -> RequestSerialized:
793
+
794
+ _host = None
795
+
796
+ _collection_formats: Dict[str, str] = {
797
+ }
798
+
799
+ _path_params: Dict[str, str] = {}
800
+ _query_params: List[Tuple[str, str]] = []
801
+ _header_params: Dict[str, Optional[str]] = _headers or {}
802
+ _form_params: List[Tuple[str, str]] = []
803
+ _files: Dict[
804
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
805
+ ] = {}
806
+ _body_params: Optional[bytes] = None
807
+
808
+ # process the path parameters
809
+ # process the query parameters
810
+ if url is not None:
811
+
812
+ _query_params.append(('url', url))
813
+
814
+ # process the header parameters
815
+ # process the form parameters
816
+ # process the body parameter
817
+
818
+
819
+ # set the HTTP header `Accept`
820
+ if 'Accept' not in _header_params:
821
+ _header_params['Accept'] = self.api_client.select_header_accept(
822
+ [
823
+ 'text/plain',
824
+ 'application/json',
825
+ 'text/json'
826
+ ]
827
+ )
828
+
829
+
830
+ # authentication setting
831
+ _auth_settings: List[str] = [
832
+ 'bearer',
833
+ 'oauth2'
834
+ ]
835
+
836
+ return self.api_client.param_serialize(
837
+ method='POST',
838
+ resource_path='/asset/url',
839
+ path_params=_path_params,
840
+ query_params=_query_params,
841
+ header_params=_header_params,
842
+ body=_body_params,
843
+ post_params=_form_params,
844
+ files=_files,
845
+ auth_settings=_auth_settings,
846
+ collection_formats=_collection_formats,
847
+ _host=_host,
848
+ _request_auth=_request_auth
849
+ )
850
+
851
+