beetkeeper-api-client 0.12.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.
Files changed (48) hide show
  1. beetkeeper_api_client/__init__.py +112 -0
  2. beetkeeper_api_client/_scm_version.py +1 -0
  3. beetkeeper_api_client/api/__init__.py +9 -0
  4. beetkeeper_api_client/api/authentication_api.py +758 -0
  5. beetkeeper_api_client/api/events_api.py +1663 -0
  6. beetkeeper_api_client/api/imports_api.py +3134 -0
  7. beetkeeper_api_client/api/monitoring_api.py +377 -0
  8. beetkeeper_api_client/api/query_api.py +1250 -0
  9. beetkeeper_api_client/api_client.py +845 -0
  10. beetkeeper_api_client/api_response.py +21 -0
  11. beetkeeper_api_client/configuration.py +604 -0
  12. beetkeeper_api_client/exceptions.py +218 -0
  13. beetkeeper_api_client/models/__init__.py +44 -0
  14. beetkeeper_api_client/models/api_album.py +285 -0
  15. beetkeeper_api_client/models/api_track.py +528 -0
  16. beetkeeper_api_client/models/beets_event_type.py +40 -0
  17. beetkeeper_api_client/models/clean_slate_preview.py +147 -0
  18. beetkeeper_api_client/models/clean_slate_submit_request.py +116 -0
  19. beetkeeper_api_client/models/current_beets_subject_state.py +140 -0
  20. beetkeeper_api_client/models/decision_request.py +104 -0
  21. beetkeeper_api_client/models/event_search_response.py +97 -0
  22. beetkeeper_api_client/models/event_search_result.py +107 -0
  23. beetkeeper_api_client/models/event_subject_summary.py +100 -0
  24. beetkeeper_api_client/models/events_list_response.py +95 -0
  25. beetkeeper_api_client/models/find_missing_source_path_request.py +100 -0
  26. beetkeeper_api_client/models/find_missing_source_path_response.py +108 -0
  27. beetkeeper_api_client/models/health_info.py +101 -0
  28. beetkeeper_api_client/models/http_validation_error.py +95 -0
  29. beetkeeper_api_client/models/import_action.py +38 -0
  30. beetkeeper_api_client/models/import_candidate.py +171 -0
  31. beetkeeper_api_client/models/import_decision.py +96 -0
  32. beetkeeper_api_client/models/import_job.py +162 -0
  33. beetkeeper_api_client/models/import_job_status.py +41 -0
  34. beetkeeper_api_client/models/import_submit_request.py +104 -0
  35. beetkeeper_api_client/models/listener_event_details.py +121 -0
  36. beetkeeper_api_client/models/location_inner.py +138 -0
  37. beetkeeper_api_client/models/login_request_body.py +90 -0
  38. beetkeeper_api_client/models/login_response_body.py +100 -0
  39. beetkeeper_api_client/models/logout_response_body.py +88 -0
  40. beetkeeper_api_client/models/search_missing_source_path_result.py +106 -0
  41. beetkeeper_api_client/models/validation_error.py +108 -0
  42. beetkeeper_api_client/py.typed +0 -0
  43. beetkeeper_api_client/rest.py +201 -0
  44. beetkeeper_api_client/sync_helper.py +57 -0
  45. beetkeeper_api_client-0.12.0.dist-info/METADATA +34 -0
  46. beetkeeper_api_client-0.12.0.dist-info/RECORD +48 -0
  47. beetkeeper_api_client-0.12.0.dist-info/WHEEL +5 -0
  48. beetkeeper_api_client-0.12.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3134 @@
1
+ """
2
+ beetkeeper
3
+
4
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document:
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictBool, StrictInt, StrictStr
19
+ from typing import List, Optional
20
+ from typing_extensions import Annotated
21
+ from beetkeeper_api_client.models.clean_slate_preview import CleanSlatePreview
22
+ from beetkeeper_api_client.models.clean_slate_submit_request import CleanSlateSubmitRequest
23
+ from beetkeeper_api_client.models.find_missing_source_path_request import FindMissingSourcePathRequest
24
+ from beetkeeper_api_client.models.find_missing_source_path_response import FindMissingSourcePathResponse
25
+ from beetkeeper_api_client.models.import_decision import ImportDecision
26
+ from beetkeeper_api_client.models.import_job import ImportJob
27
+ from beetkeeper_api_client.models.import_submit_request import ImportSubmitRequest
28
+
29
+ from beetkeeper_api_client.api_client import ApiClient, RequestSerialized
30
+ from beetkeeper_api_client.api_response import ApiResponse
31
+ from beetkeeper_api_client.rest import RESTResponseType
32
+ from beetkeeper_api_client.sync_helper import run_sync
33
+
34
+
35
+ class ImportsApi:
36
+ """NOTE: This class is auto generated by OpenAPI Generator
37
+ Ref: https://openapi-generator.tech
38
+
39
+ Do not edit the class manually.
40
+ """
41
+
42
+ def __init__(self, api_client=None) -> None:
43
+ if api_client is None:
44
+ api_client = ApiClient.get_default()
45
+ self.api_client = api_client
46
+
47
+
48
+ @validate_call
49
+ async def abort_import_api_import_job_id_abort_post(
50
+ self,
51
+ job_id: StrictStr,
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> ImportJob:
65
+ """Abort Import
66
+
67
+ Request cooperative cancellation of an in-flight import.
68
+
69
+ :param job_id: (required)
70
+ :type job_id: str
71
+ :param _request_timeout: timeout setting for this request. If one
72
+ number provided, it will be total request
73
+ timeout. It can also be a pair (tuple) of
74
+ (connection, read) timeouts.
75
+ :type _request_timeout: int, tuple(int, int), optional
76
+ :param _request_auth: set to override the auth_settings for an a single
77
+ request; this effectively ignores the
78
+ authentication in the spec for a single request.
79
+ :type _request_auth: dict, optional
80
+ :param _content_type: force content-type for the request.
81
+ :type _content_type: str, Optional
82
+ :param _headers: set to override the headers for a single
83
+ request; this effectively ignores the headers
84
+ in the spec for a single request.
85
+ :type _headers: dict, optional
86
+ :param _host_index: set to override the host_index for a single
87
+ request; this effectively ignores the host_index
88
+ in the spec for a single request.
89
+ :type _host_index: int, optional
90
+ :return: Returns the result object.
91
+ """ # noqa: E501
92
+
93
+ _param = self._abort_import_api_import_job_id_abort_post_serialize(
94
+ job_id=job_id,
95
+ _request_auth=_request_auth,
96
+ _content_type=_content_type,
97
+ _headers=_headers,
98
+ _host_index=_host_index
99
+ )
100
+
101
+ _response_types_map: Dict[str, Optional[str]] = {
102
+ '200': "ImportJob",
103
+ '422': "HTTPValidationError",
104
+ }
105
+ response_data = await self.api_client.call_api(
106
+ *_param,
107
+ _request_timeout=_request_timeout
108
+ )
109
+ await response_data.read()
110
+ return self.api_client.response_deserialize(
111
+ response_data=response_data,
112
+ response_types_map=_response_types_map,
113
+ ).data
114
+
115
+
116
+ @validate_call
117
+ async def abort_import_api_import_job_id_abort_post_with_http_info(
118
+ self,
119
+ job_id: StrictStr,
120
+ _request_timeout: Union[
121
+ None,
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Tuple[
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Annotated[StrictFloat, Field(gt=0)]
126
+ ]
127
+ ] = None,
128
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
129
+ _content_type: Optional[StrictStr] = None,
130
+ _headers: Optional[Dict[StrictStr, Any]] = None,
131
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
132
+ ) -> ApiResponse[ImportJob]:
133
+ """Abort Import
134
+
135
+ Request cooperative cancellation of an in-flight import.
136
+
137
+ :param job_id: (required)
138
+ :type job_id: str
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._abort_import_api_import_job_id_abort_post_serialize(
162
+ job_id=job_id,
163
+ _request_auth=_request_auth,
164
+ _content_type=_content_type,
165
+ _headers=_headers,
166
+ _host_index=_host_index
167
+ )
168
+
169
+ _response_types_map: Dict[str, Optional[str]] = {
170
+ '200': "ImportJob",
171
+ '422': "HTTPValidationError",
172
+ }
173
+ response_data = await self.api_client.call_api(
174
+ *_param,
175
+ _request_timeout=_request_timeout
176
+ )
177
+ await 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
+ async def abort_import_api_import_job_id_abort_post_without_preload_content(
186
+ self,
187
+ job_id: StrictStr,
188
+ _request_timeout: Union[
189
+ None,
190
+ Annotated[StrictFloat, Field(gt=0)],
191
+ Tuple[
192
+ Annotated[StrictFloat, Field(gt=0)],
193
+ Annotated[StrictFloat, Field(gt=0)]
194
+ ]
195
+ ] = None,
196
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
197
+ _content_type: Optional[StrictStr] = None,
198
+ _headers: Optional[Dict[StrictStr, Any]] = None,
199
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
200
+ ) -> RESTResponseType:
201
+ """Abort Import
202
+
203
+ Request cooperative cancellation of an in-flight import.
204
+
205
+ :param job_id: (required)
206
+ :type job_id: str
207
+ :param _request_timeout: timeout setting for this request. If one
208
+ number provided, it will be total request
209
+ timeout. It can also be a pair (tuple) of
210
+ (connection, read) timeouts.
211
+ :type _request_timeout: int, tuple(int, int), optional
212
+ :param _request_auth: set to override the auth_settings for an a single
213
+ request; this effectively ignores the
214
+ authentication in the spec for a single request.
215
+ :type _request_auth: dict, optional
216
+ :param _content_type: force content-type for the request.
217
+ :type _content_type: str, Optional
218
+ :param _headers: set to override the headers for a single
219
+ request; this effectively ignores the headers
220
+ in the spec for a single request.
221
+ :type _headers: dict, optional
222
+ :param _host_index: set to override the host_index for a single
223
+ request; this effectively ignores the host_index
224
+ in the spec for a single request.
225
+ :type _host_index: int, optional
226
+ :return: Returns the result object.
227
+ """ # noqa: E501
228
+
229
+ _param = self._abort_import_api_import_job_id_abort_post_serialize(
230
+ job_id=job_id,
231
+ _request_auth=_request_auth,
232
+ _content_type=_content_type,
233
+ _headers=_headers,
234
+ _host_index=_host_index
235
+ )
236
+
237
+ _response_types_map: Dict[str, Optional[str]] = {
238
+ '200': "ImportJob",
239
+ '422': "HTTPValidationError",
240
+ }
241
+ response_data = await self.api_client.call_api(
242
+ *_param,
243
+ _request_timeout=_request_timeout
244
+ )
245
+ return response_data.response
246
+
247
+
248
+ @validate_call
249
+ def abort_import_api_import_job_id_abort_post_sync(
250
+ self,
251
+ job_id: StrictStr,
252
+ _request_timeout: Union[
253
+ None,
254
+ Annotated[StrictFloat, Field(gt=0)],
255
+ Tuple[
256
+ Annotated[StrictFloat, Field(gt=0)],
257
+ Annotated[StrictFloat, Field(gt=0)]
258
+ ]
259
+ ] = None,
260
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
261
+ _content_type: Optional[StrictStr] = None,
262
+ _headers: Optional[Dict[StrictStr, Any]] = None,
263
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
264
+ ) -> ImportJob:
265
+ """Abort Import (synchronous)
266
+
267
+ Synchronous variant of :meth:`abort_import_api_import_job_id_abort_post`. It calls the asynchronous
268
+ method and blocks until it completes.
269
+ """ # noqa: E501
270
+ return run_sync(
271
+ self.abort_import_api_import_job_id_abort_post(
272
+ job_id=job_id,
273
+ _request_timeout=_request_timeout,
274
+ _request_auth=_request_auth,
275
+ _content_type=_content_type,
276
+ _headers=_headers,
277
+ _host_index=_host_index,
278
+ )
279
+ )
280
+
281
+
282
+ @validate_call
283
+ def abort_import_api_import_job_id_abort_post_sync_with_http_info(
284
+ self,
285
+ job_id: StrictStr,
286
+ _request_timeout: Union[
287
+ None,
288
+ Annotated[StrictFloat, Field(gt=0)],
289
+ Tuple[
290
+ Annotated[StrictFloat, Field(gt=0)],
291
+ Annotated[StrictFloat, Field(gt=0)]
292
+ ]
293
+ ] = None,
294
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
295
+ _content_type: Optional[StrictStr] = None,
296
+ _headers: Optional[Dict[StrictStr, Any]] = None,
297
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
298
+ ) -> ApiResponse[ImportJob]:
299
+ """Abort Import (synchronous)
300
+
301
+ Synchronous variant of :meth:`abort_import_api_import_job_id_abort_post_with_http_info`. It calls the
302
+ asynchronous method and blocks until it completes.
303
+ """ # noqa: E501
304
+ return run_sync(
305
+ self.abort_import_api_import_job_id_abort_post_with_http_info(
306
+ job_id=job_id,
307
+ _request_timeout=_request_timeout,
308
+ _request_auth=_request_auth,
309
+ _content_type=_content_type,
310
+ _headers=_headers,
311
+ _host_index=_host_index,
312
+ )
313
+ )
314
+
315
+
316
+ @validate_call
317
+ def abort_import_api_import_job_id_abort_post_sync_without_preload_content(
318
+ self,
319
+ job_id: StrictStr,
320
+ _request_timeout: Union[
321
+ None,
322
+ Annotated[StrictFloat, Field(gt=0)],
323
+ Tuple[
324
+ Annotated[StrictFloat, Field(gt=0)],
325
+ Annotated[StrictFloat, Field(gt=0)]
326
+ ]
327
+ ] = None,
328
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
329
+ _content_type: Optional[StrictStr] = None,
330
+ _headers: Optional[Dict[StrictStr, Any]] = None,
331
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
332
+ ) -> RESTResponseType:
333
+ """Abort Import (synchronous)
334
+
335
+ Synchronous variant of :meth:`abort_import_api_import_job_id_abort_post_without_preload_content`. It calls
336
+ the asynchronous method and blocks until it completes.
337
+ """ # noqa: E501
338
+ return run_sync(
339
+ self.abort_import_api_import_job_id_abort_post_without_preload_content(
340
+ job_id=job_id,
341
+ _request_timeout=_request_timeout,
342
+ _request_auth=_request_auth,
343
+ _content_type=_content_type,
344
+ _headers=_headers,
345
+ _host_index=_host_index,
346
+ )
347
+ )
348
+
349
+
350
+ def _abort_import_api_import_job_id_abort_post_serialize(
351
+ self,
352
+ job_id,
353
+ _request_auth,
354
+ _content_type,
355
+ _headers,
356
+ _host_index,
357
+ ) -> RequestSerialized:
358
+
359
+ _host = None
360
+
361
+ _collection_formats: Dict[str, str] = {
362
+ }
363
+
364
+ _path_params: Dict[str, str] = {}
365
+ _query_params: List[Tuple[str, str]] = []
366
+ _header_params: Dict[str, Optional[str]] = _headers or {}
367
+ _form_params: List[Tuple[str, str]] = []
368
+ _files: Dict[
369
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
370
+ ] = {}
371
+ _body_params: Optional[bytes] = None
372
+
373
+ # process the path parameters
374
+ if job_id is not None:
375
+ _path_params['job_id'] = job_id
376
+ # process the query parameters
377
+ # process the header parameters
378
+ # process the form parameters
379
+ # process the body parameter
380
+
381
+
382
+ # set the HTTP header `Accept`
383
+ if 'Accept' not in _header_params:
384
+ _header_params['Accept'] = self.api_client.select_header_accept(
385
+ [
386
+ 'application/json'
387
+ ]
388
+ )
389
+
390
+
391
+ # authentication setting
392
+ _auth_settings: List[str] = [
393
+ ]
394
+
395
+ return self.api_client.param_serialize(
396
+ method='POST',
397
+ resource_path='/api/import/{job_id}/abort',
398
+ path_params=_path_params,
399
+ query_params=_query_params,
400
+ header_params=_header_params,
401
+ body=_body_params,
402
+ post_params=_form_params,
403
+ files=_files,
404
+ auth_settings=_auth_settings,
405
+ collection_formats=_collection_formats,
406
+ _host=_host,
407
+ _request_auth=_request_auth
408
+ )
409
+
410
+
411
+
412
+
413
+ @validate_call
414
+ async def decide_import_api_import_job_id_decision_post(
415
+ self,
416
+ job_id: StrictStr,
417
+ import_decision: ImportDecision,
418
+ _request_timeout: Union[
419
+ None,
420
+ Annotated[StrictFloat, Field(gt=0)],
421
+ Tuple[
422
+ Annotated[StrictFloat, Field(gt=0)],
423
+ Annotated[StrictFloat, Field(gt=0)]
424
+ ]
425
+ ] = None,
426
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
427
+ _content_type: Optional[StrictStr] = None,
428
+ _headers: Optional[Dict[StrictStr, Any]] = None,
429
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
430
+ ) -> ImportJob:
431
+ """Decide Import
432
+
433
+ Answer the decision an import is parked on; 409 if it isn't awaiting one.
434
+
435
+ :param job_id: (required)
436
+ :type job_id: str
437
+ :param import_decision: (required)
438
+ :type import_decision: ImportDecision
439
+ :param _request_timeout: timeout setting for this request. If one
440
+ number provided, it will be total request
441
+ timeout. It can also be a pair (tuple) of
442
+ (connection, read) timeouts.
443
+ :type _request_timeout: int, tuple(int, int), optional
444
+ :param _request_auth: set to override the auth_settings for an a single
445
+ request; this effectively ignores the
446
+ authentication in the spec for a single request.
447
+ :type _request_auth: dict, optional
448
+ :param _content_type: force content-type for the request.
449
+ :type _content_type: str, Optional
450
+ :param _headers: set to override the headers for a single
451
+ request; this effectively ignores the headers
452
+ in the spec for a single request.
453
+ :type _headers: dict, optional
454
+ :param _host_index: set to override the host_index for a single
455
+ request; this effectively ignores the host_index
456
+ in the spec for a single request.
457
+ :type _host_index: int, optional
458
+ :return: Returns the result object.
459
+ """ # noqa: E501
460
+
461
+ _param = self._decide_import_api_import_job_id_decision_post_serialize(
462
+ job_id=job_id,
463
+ import_decision=import_decision,
464
+ _request_auth=_request_auth,
465
+ _content_type=_content_type,
466
+ _headers=_headers,
467
+ _host_index=_host_index
468
+ )
469
+
470
+ _response_types_map: Dict[str, Optional[str]] = {
471
+ '200': "ImportJob",
472
+ '422': "HTTPValidationError",
473
+ }
474
+ response_data = await self.api_client.call_api(
475
+ *_param,
476
+ _request_timeout=_request_timeout
477
+ )
478
+ await response_data.read()
479
+ return self.api_client.response_deserialize(
480
+ response_data=response_data,
481
+ response_types_map=_response_types_map,
482
+ ).data
483
+
484
+
485
+ @validate_call
486
+ async def decide_import_api_import_job_id_decision_post_with_http_info(
487
+ self,
488
+ job_id: StrictStr,
489
+ import_decision: ImportDecision,
490
+ _request_timeout: Union[
491
+ None,
492
+ Annotated[StrictFloat, Field(gt=0)],
493
+ Tuple[
494
+ Annotated[StrictFloat, Field(gt=0)],
495
+ Annotated[StrictFloat, Field(gt=0)]
496
+ ]
497
+ ] = None,
498
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
499
+ _content_type: Optional[StrictStr] = None,
500
+ _headers: Optional[Dict[StrictStr, Any]] = None,
501
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
502
+ ) -> ApiResponse[ImportJob]:
503
+ """Decide Import
504
+
505
+ Answer the decision an import is parked on; 409 if it isn't awaiting one.
506
+
507
+ :param job_id: (required)
508
+ :type job_id: str
509
+ :param import_decision: (required)
510
+ :type import_decision: ImportDecision
511
+ :param _request_timeout: timeout setting for this request. If one
512
+ number provided, it will be total request
513
+ timeout. It can also be a pair (tuple) of
514
+ (connection, read) timeouts.
515
+ :type _request_timeout: int, tuple(int, int), optional
516
+ :param _request_auth: set to override the auth_settings for an a single
517
+ request; this effectively ignores the
518
+ authentication in the spec for a single request.
519
+ :type _request_auth: dict, optional
520
+ :param _content_type: force content-type for the request.
521
+ :type _content_type: str, Optional
522
+ :param _headers: set to override the headers for a single
523
+ request; this effectively ignores the headers
524
+ in the spec for a single request.
525
+ :type _headers: dict, optional
526
+ :param _host_index: set to override the host_index for a single
527
+ request; this effectively ignores the host_index
528
+ in the spec for a single request.
529
+ :type _host_index: int, optional
530
+ :return: Returns the result object.
531
+ """ # noqa: E501
532
+
533
+ _param = self._decide_import_api_import_job_id_decision_post_serialize(
534
+ job_id=job_id,
535
+ import_decision=import_decision,
536
+ _request_auth=_request_auth,
537
+ _content_type=_content_type,
538
+ _headers=_headers,
539
+ _host_index=_host_index
540
+ )
541
+
542
+ _response_types_map: Dict[str, Optional[str]] = {
543
+ '200': "ImportJob",
544
+ '422': "HTTPValidationError",
545
+ }
546
+ response_data = await self.api_client.call_api(
547
+ *_param,
548
+ _request_timeout=_request_timeout
549
+ )
550
+ await response_data.read()
551
+ return self.api_client.response_deserialize(
552
+ response_data=response_data,
553
+ response_types_map=_response_types_map,
554
+ )
555
+
556
+
557
+ @validate_call
558
+ async def decide_import_api_import_job_id_decision_post_without_preload_content(
559
+ self,
560
+ job_id: StrictStr,
561
+ import_decision: ImportDecision,
562
+ _request_timeout: Union[
563
+ None,
564
+ Annotated[StrictFloat, Field(gt=0)],
565
+ Tuple[
566
+ Annotated[StrictFloat, Field(gt=0)],
567
+ Annotated[StrictFloat, Field(gt=0)]
568
+ ]
569
+ ] = None,
570
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
571
+ _content_type: Optional[StrictStr] = None,
572
+ _headers: Optional[Dict[StrictStr, Any]] = None,
573
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
574
+ ) -> RESTResponseType:
575
+ """Decide Import
576
+
577
+ Answer the decision an import is parked on; 409 if it isn't awaiting one.
578
+
579
+ :param job_id: (required)
580
+ :type job_id: str
581
+ :param import_decision: (required)
582
+ :type import_decision: ImportDecision
583
+ :param _request_timeout: timeout setting for this request. If one
584
+ number provided, it will be total request
585
+ timeout. It can also be a pair (tuple) of
586
+ (connection, read) timeouts.
587
+ :type _request_timeout: int, tuple(int, int), optional
588
+ :param _request_auth: set to override the auth_settings for an a single
589
+ request; this effectively ignores the
590
+ authentication in the spec for a single request.
591
+ :type _request_auth: dict, optional
592
+ :param _content_type: force content-type for the request.
593
+ :type _content_type: str, Optional
594
+ :param _headers: set to override the headers for a single
595
+ request; this effectively ignores the headers
596
+ in the spec for a single request.
597
+ :type _headers: dict, optional
598
+ :param _host_index: set to override the host_index for a single
599
+ request; this effectively ignores the host_index
600
+ in the spec for a single request.
601
+ :type _host_index: int, optional
602
+ :return: Returns the result object.
603
+ """ # noqa: E501
604
+
605
+ _param = self._decide_import_api_import_job_id_decision_post_serialize(
606
+ job_id=job_id,
607
+ import_decision=import_decision,
608
+ _request_auth=_request_auth,
609
+ _content_type=_content_type,
610
+ _headers=_headers,
611
+ _host_index=_host_index
612
+ )
613
+
614
+ _response_types_map: Dict[str, Optional[str]] = {
615
+ '200': "ImportJob",
616
+ '422': "HTTPValidationError",
617
+ }
618
+ response_data = await self.api_client.call_api(
619
+ *_param,
620
+ _request_timeout=_request_timeout
621
+ )
622
+ return response_data.response
623
+
624
+
625
+ @validate_call
626
+ def decide_import_api_import_job_id_decision_post_sync(
627
+ self,
628
+ job_id: StrictStr,
629
+ import_decision: ImportDecision,
630
+ _request_timeout: Union[
631
+ None,
632
+ Annotated[StrictFloat, Field(gt=0)],
633
+ Tuple[
634
+ Annotated[StrictFloat, Field(gt=0)],
635
+ Annotated[StrictFloat, Field(gt=0)]
636
+ ]
637
+ ] = None,
638
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
639
+ _content_type: Optional[StrictStr] = None,
640
+ _headers: Optional[Dict[StrictStr, Any]] = None,
641
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
642
+ ) -> ImportJob:
643
+ """Decide Import (synchronous)
644
+
645
+ Synchronous variant of :meth:`decide_import_api_import_job_id_decision_post`. It calls the asynchronous
646
+ method and blocks until it completes.
647
+ """ # noqa: E501
648
+ return run_sync(
649
+ self.decide_import_api_import_job_id_decision_post(
650
+ job_id=job_id,
651
+ import_decision=import_decision,
652
+ _request_timeout=_request_timeout,
653
+ _request_auth=_request_auth,
654
+ _content_type=_content_type,
655
+ _headers=_headers,
656
+ _host_index=_host_index,
657
+ )
658
+ )
659
+
660
+
661
+ @validate_call
662
+ def decide_import_api_import_job_id_decision_post_sync_with_http_info(
663
+ self,
664
+ job_id: StrictStr,
665
+ import_decision: ImportDecision,
666
+ _request_timeout: Union[
667
+ None,
668
+ Annotated[StrictFloat, Field(gt=0)],
669
+ Tuple[
670
+ Annotated[StrictFloat, Field(gt=0)],
671
+ Annotated[StrictFloat, Field(gt=0)]
672
+ ]
673
+ ] = None,
674
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
675
+ _content_type: Optional[StrictStr] = None,
676
+ _headers: Optional[Dict[StrictStr, Any]] = None,
677
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
678
+ ) -> ApiResponse[ImportJob]:
679
+ """Decide Import (synchronous)
680
+
681
+ Synchronous variant of :meth:`decide_import_api_import_job_id_decision_post_with_http_info`. It calls the
682
+ asynchronous method and blocks until it completes.
683
+ """ # noqa: E501
684
+ return run_sync(
685
+ self.decide_import_api_import_job_id_decision_post_with_http_info(
686
+ job_id=job_id,
687
+ import_decision=import_decision,
688
+ _request_timeout=_request_timeout,
689
+ _request_auth=_request_auth,
690
+ _content_type=_content_type,
691
+ _headers=_headers,
692
+ _host_index=_host_index,
693
+ )
694
+ )
695
+
696
+
697
+ @validate_call
698
+ def decide_import_api_import_job_id_decision_post_sync_without_preload_content(
699
+ self,
700
+ job_id: StrictStr,
701
+ import_decision: ImportDecision,
702
+ _request_timeout: Union[
703
+ None,
704
+ Annotated[StrictFloat, Field(gt=0)],
705
+ Tuple[
706
+ Annotated[StrictFloat, Field(gt=0)],
707
+ Annotated[StrictFloat, Field(gt=0)]
708
+ ]
709
+ ] = None,
710
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
711
+ _content_type: Optional[StrictStr] = None,
712
+ _headers: Optional[Dict[StrictStr, Any]] = None,
713
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
714
+ ) -> RESTResponseType:
715
+ """Decide Import (synchronous)
716
+
717
+ Synchronous variant of :meth:`decide_import_api_import_job_id_decision_post_without_preload_content`. It calls
718
+ the asynchronous method and blocks until it completes.
719
+ """ # noqa: E501
720
+ return run_sync(
721
+ self.decide_import_api_import_job_id_decision_post_without_preload_content(
722
+ job_id=job_id,
723
+ import_decision=import_decision,
724
+ _request_timeout=_request_timeout,
725
+ _request_auth=_request_auth,
726
+ _content_type=_content_type,
727
+ _headers=_headers,
728
+ _host_index=_host_index,
729
+ )
730
+ )
731
+
732
+
733
+ def _decide_import_api_import_job_id_decision_post_serialize(
734
+ self,
735
+ job_id,
736
+ import_decision,
737
+ _request_auth,
738
+ _content_type,
739
+ _headers,
740
+ _host_index,
741
+ ) -> RequestSerialized:
742
+
743
+ _host = None
744
+
745
+ _collection_formats: Dict[str, str] = {
746
+ }
747
+
748
+ _path_params: Dict[str, str] = {}
749
+ _query_params: List[Tuple[str, str]] = []
750
+ _header_params: Dict[str, Optional[str]] = _headers or {}
751
+ _form_params: List[Tuple[str, str]] = []
752
+ _files: Dict[
753
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
754
+ ] = {}
755
+ _body_params: Optional[bytes] = None
756
+
757
+ # process the path parameters
758
+ if job_id is not None:
759
+ _path_params['job_id'] = job_id
760
+ # process the query parameters
761
+ # process the header parameters
762
+ # process the form parameters
763
+ # process the body parameter
764
+ if import_decision is not None:
765
+ _body_params = import_decision
766
+
767
+
768
+ # set the HTTP header `Accept`
769
+ if 'Accept' not in _header_params:
770
+ _header_params['Accept'] = self.api_client.select_header_accept(
771
+ [
772
+ 'application/json'
773
+ ]
774
+ )
775
+
776
+ # set the HTTP header `Content-Type`
777
+ if _content_type:
778
+ _header_params['Content-Type'] = _content_type
779
+ else:
780
+ _default_content_type = (
781
+ self.api_client.select_header_content_type(
782
+ [
783
+ 'application/json'
784
+ ]
785
+ )
786
+ )
787
+ if _default_content_type is not None:
788
+ _header_params['Content-Type'] = _default_content_type
789
+
790
+ # authentication setting
791
+ _auth_settings: List[str] = [
792
+ ]
793
+
794
+ return self.api_client.param_serialize(
795
+ method='POST',
796
+ resource_path='/api/import/{job_id}/decision',
797
+ path_params=_path_params,
798
+ query_params=_query_params,
799
+ header_params=_header_params,
800
+ body=_body_params,
801
+ post_params=_form_params,
802
+ files=_files,
803
+ auth_settings=_auth_settings,
804
+ collection_formats=_collection_formats,
805
+ _host=_host,
806
+ _request_auth=_request_auth
807
+ )
808
+
809
+
810
+
811
+
812
+ @validate_call
813
+ async def find_missing_source_path_api_import_find_missing_source_path_post(
814
+ self,
815
+ find_missing_source_path_request: FindMissingSourcePathRequest,
816
+ _request_timeout: Union[
817
+ None,
818
+ Annotated[StrictFloat, Field(gt=0)],
819
+ Tuple[
820
+ Annotated[StrictFloat, Field(gt=0)],
821
+ Annotated[StrictFloat, Field(gt=0)]
822
+ ]
823
+ ] = None,
824
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
825
+ _content_type: Optional[StrictStr] = None,
826
+ _headers: Optional[Dict[StrictStr, Any]] = None,
827
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
828
+ ) -> FindMissingSourcePathResponse:
829
+ """Find Missing Source Path
830
+
831
+ Ask the configured downloader client where a library album/track was originally downloaded to. Only useful for entries imported outside a beetkeeper context (so no source path was recorded): the recovered pre-import folder is what a clean-slate import of the entry needs. The entry's fields named in the beets config's `beetkeeper.downloader_hook.beet_field_to_dl_search_field` become the search request's query params (see the `search-missing-source-path` webhook). A match is stored as the entry's *inferred* source path (replacing any earlier inference), which the search page then shows labelled as inferred — separate from source paths recorded from the beetkeeper plugin's events. 409 when no downloader API is configured; 404 for an unknown beets id.
832
+
833
+ :param find_missing_source_path_request: (required)
834
+ :type find_missing_source_path_request: FindMissingSourcePathRequest
835
+ :param _request_timeout: timeout setting for this request. If one
836
+ number provided, it will be total request
837
+ timeout. It can also be a pair (tuple) of
838
+ (connection, read) timeouts.
839
+ :type _request_timeout: int, tuple(int, int), optional
840
+ :param _request_auth: set to override the auth_settings for an a single
841
+ request; this effectively ignores the
842
+ authentication in the spec for a single request.
843
+ :type _request_auth: dict, optional
844
+ :param _content_type: force content-type for the request.
845
+ :type _content_type: str, Optional
846
+ :param _headers: set to override the headers for a single
847
+ request; this effectively ignores the headers
848
+ in the spec for a single request.
849
+ :type _headers: dict, optional
850
+ :param _host_index: set to override the host_index for a single
851
+ request; this effectively ignores the host_index
852
+ in the spec for a single request.
853
+ :type _host_index: int, optional
854
+ :return: Returns the result object.
855
+ """ # noqa: E501
856
+
857
+ _param = self._find_missing_source_path_api_import_find_missing_source_path_post_serialize(
858
+ find_missing_source_path_request=find_missing_source_path_request,
859
+ _request_auth=_request_auth,
860
+ _content_type=_content_type,
861
+ _headers=_headers,
862
+ _host_index=_host_index
863
+ )
864
+
865
+ _response_types_map: Dict[str, Optional[str]] = {
866
+ '200': "FindMissingSourcePathResponse",
867
+ '422': "HTTPValidationError",
868
+ }
869
+ response_data = await self.api_client.call_api(
870
+ *_param,
871
+ _request_timeout=_request_timeout
872
+ )
873
+ await response_data.read()
874
+ return self.api_client.response_deserialize(
875
+ response_data=response_data,
876
+ response_types_map=_response_types_map,
877
+ ).data
878
+
879
+
880
+ @validate_call
881
+ async def find_missing_source_path_api_import_find_missing_source_path_post_with_http_info(
882
+ self,
883
+ find_missing_source_path_request: FindMissingSourcePathRequest,
884
+ _request_timeout: Union[
885
+ None,
886
+ Annotated[StrictFloat, Field(gt=0)],
887
+ Tuple[
888
+ Annotated[StrictFloat, Field(gt=0)],
889
+ Annotated[StrictFloat, Field(gt=0)]
890
+ ]
891
+ ] = None,
892
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
893
+ _content_type: Optional[StrictStr] = None,
894
+ _headers: Optional[Dict[StrictStr, Any]] = None,
895
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
896
+ ) -> ApiResponse[FindMissingSourcePathResponse]:
897
+ """Find Missing Source Path
898
+
899
+ Ask the configured downloader client where a library album/track was originally downloaded to. Only useful for entries imported outside a beetkeeper context (so no source path was recorded): the recovered pre-import folder is what a clean-slate import of the entry needs. The entry's fields named in the beets config's `beetkeeper.downloader_hook.beet_field_to_dl_search_field` become the search request's query params (see the `search-missing-source-path` webhook). A match is stored as the entry's *inferred* source path (replacing any earlier inference), which the search page then shows labelled as inferred — separate from source paths recorded from the beetkeeper plugin's events. 409 when no downloader API is configured; 404 for an unknown beets id.
900
+
901
+ :param find_missing_source_path_request: (required)
902
+ :type find_missing_source_path_request: FindMissingSourcePathRequest
903
+ :param _request_timeout: timeout setting for this request. If one
904
+ number provided, it will be total request
905
+ timeout. It can also be a pair (tuple) of
906
+ (connection, read) timeouts.
907
+ :type _request_timeout: int, tuple(int, int), optional
908
+ :param _request_auth: set to override the auth_settings for an a single
909
+ request; this effectively ignores the
910
+ authentication in the spec for a single request.
911
+ :type _request_auth: dict, optional
912
+ :param _content_type: force content-type for the request.
913
+ :type _content_type: str, Optional
914
+ :param _headers: set to override the headers for a single
915
+ request; this effectively ignores the headers
916
+ in the spec for a single request.
917
+ :type _headers: dict, optional
918
+ :param _host_index: set to override the host_index for a single
919
+ request; this effectively ignores the host_index
920
+ in the spec for a single request.
921
+ :type _host_index: int, optional
922
+ :return: Returns the result object.
923
+ """ # noqa: E501
924
+
925
+ _param = self._find_missing_source_path_api_import_find_missing_source_path_post_serialize(
926
+ find_missing_source_path_request=find_missing_source_path_request,
927
+ _request_auth=_request_auth,
928
+ _content_type=_content_type,
929
+ _headers=_headers,
930
+ _host_index=_host_index
931
+ )
932
+
933
+ _response_types_map: Dict[str, Optional[str]] = {
934
+ '200': "FindMissingSourcePathResponse",
935
+ '422': "HTTPValidationError",
936
+ }
937
+ response_data = await self.api_client.call_api(
938
+ *_param,
939
+ _request_timeout=_request_timeout
940
+ )
941
+ await response_data.read()
942
+ return self.api_client.response_deserialize(
943
+ response_data=response_data,
944
+ response_types_map=_response_types_map,
945
+ )
946
+
947
+
948
+ @validate_call
949
+ async def find_missing_source_path_api_import_find_missing_source_path_post_without_preload_content(
950
+ self,
951
+ find_missing_source_path_request: FindMissingSourcePathRequest,
952
+ _request_timeout: Union[
953
+ None,
954
+ Annotated[StrictFloat, Field(gt=0)],
955
+ Tuple[
956
+ Annotated[StrictFloat, Field(gt=0)],
957
+ Annotated[StrictFloat, Field(gt=0)]
958
+ ]
959
+ ] = None,
960
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
961
+ _content_type: Optional[StrictStr] = None,
962
+ _headers: Optional[Dict[StrictStr, Any]] = None,
963
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
964
+ ) -> RESTResponseType:
965
+ """Find Missing Source Path
966
+
967
+ Ask the configured downloader client where a library album/track was originally downloaded to. Only useful for entries imported outside a beetkeeper context (so no source path was recorded): the recovered pre-import folder is what a clean-slate import of the entry needs. The entry's fields named in the beets config's `beetkeeper.downloader_hook.beet_field_to_dl_search_field` become the search request's query params (see the `search-missing-source-path` webhook). A match is stored as the entry's *inferred* source path (replacing any earlier inference), which the search page then shows labelled as inferred — separate from source paths recorded from the beetkeeper plugin's events. 409 when no downloader API is configured; 404 for an unknown beets id.
968
+
969
+ :param find_missing_source_path_request: (required)
970
+ :type find_missing_source_path_request: FindMissingSourcePathRequest
971
+ :param _request_timeout: timeout setting for this request. If one
972
+ number provided, it will be total request
973
+ timeout. It can also be a pair (tuple) of
974
+ (connection, read) timeouts.
975
+ :type _request_timeout: int, tuple(int, int), optional
976
+ :param _request_auth: set to override the auth_settings for an a single
977
+ request; this effectively ignores the
978
+ authentication in the spec for a single request.
979
+ :type _request_auth: dict, optional
980
+ :param _content_type: force content-type for the request.
981
+ :type _content_type: str, Optional
982
+ :param _headers: set to override the headers for a single
983
+ request; this effectively ignores the headers
984
+ in the spec for a single request.
985
+ :type _headers: dict, optional
986
+ :param _host_index: set to override the host_index for a single
987
+ request; this effectively ignores the host_index
988
+ in the spec for a single request.
989
+ :type _host_index: int, optional
990
+ :return: Returns the result object.
991
+ """ # noqa: E501
992
+
993
+ _param = self._find_missing_source_path_api_import_find_missing_source_path_post_serialize(
994
+ find_missing_source_path_request=find_missing_source_path_request,
995
+ _request_auth=_request_auth,
996
+ _content_type=_content_type,
997
+ _headers=_headers,
998
+ _host_index=_host_index
999
+ )
1000
+
1001
+ _response_types_map: Dict[str, Optional[str]] = {
1002
+ '200': "FindMissingSourcePathResponse",
1003
+ '422': "HTTPValidationError",
1004
+ }
1005
+ response_data = await self.api_client.call_api(
1006
+ *_param,
1007
+ _request_timeout=_request_timeout
1008
+ )
1009
+ return response_data.response
1010
+
1011
+
1012
+ @validate_call
1013
+ def find_missing_source_path_api_import_find_missing_source_path_post_sync(
1014
+ self,
1015
+ find_missing_source_path_request: FindMissingSourcePathRequest,
1016
+ _request_timeout: Union[
1017
+ None,
1018
+ Annotated[StrictFloat, Field(gt=0)],
1019
+ Tuple[
1020
+ Annotated[StrictFloat, Field(gt=0)],
1021
+ Annotated[StrictFloat, Field(gt=0)]
1022
+ ]
1023
+ ] = None,
1024
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1025
+ _content_type: Optional[StrictStr] = None,
1026
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1027
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1028
+ ) -> FindMissingSourcePathResponse:
1029
+ """Find Missing Source Path (synchronous)
1030
+
1031
+ Synchronous variant of :meth:`find_missing_source_path_api_import_find_missing_source_path_post`. It calls the asynchronous
1032
+ method and blocks until it completes.
1033
+ """ # noqa: E501
1034
+ return run_sync(
1035
+ self.find_missing_source_path_api_import_find_missing_source_path_post(
1036
+ find_missing_source_path_request=find_missing_source_path_request,
1037
+ _request_timeout=_request_timeout,
1038
+ _request_auth=_request_auth,
1039
+ _content_type=_content_type,
1040
+ _headers=_headers,
1041
+ _host_index=_host_index,
1042
+ )
1043
+ )
1044
+
1045
+
1046
+ @validate_call
1047
+ def find_missing_source_path_api_import_find_missing_source_path_post_sync_with_http_info(
1048
+ self,
1049
+ find_missing_source_path_request: FindMissingSourcePathRequest,
1050
+ _request_timeout: Union[
1051
+ None,
1052
+ Annotated[StrictFloat, Field(gt=0)],
1053
+ Tuple[
1054
+ Annotated[StrictFloat, Field(gt=0)],
1055
+ Annotated[StrictFloat, Field(gt=0)]
1056
+ ]
1057
+ ] = None,
1058
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1059
+ _content_type: Optional[StrictStr] = None,
1060
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1061
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1062
+ ) -> ApiResponse[FindMissingSourcePathResponse]:
1063
+ """Find Missing Source Path (synchronous)
1064
+
1065
+ Synchronous variant of :meth:`find_missing_source_path_api_import_find_missing_source_path_post_with_http_info`. It calls the
1066
+ asynchronous method and blocks until it completes.
1067
+ """ # noqa: E501
1068
+ return run_sync(
1069
+ self.find_missing_source_path_api_import_find_missing_source_path_post_with_http_info(
1070
+ find_missing_source_path_request=find_missing_source_path_request,
1071
+ _request_timeout=_request_timeout,
1072
+ _request_auth=_request_auth,
1073
+ _content_type=_content_type,
1074
+ _headers=_headers,
1075
+ _host_index=_host_index,
1076
+ )
1077
+ )
1078
+
1079
+
1080
+ @validate_call
1081
+ def find_missing_source_path_api_import_find_missing_source_path_post_sync_without_preload_content(
1082
+ self,
1083
+ find_missing_source_path_request: FindMissingSourcePathRequest,
1084
+ _request_timeout: Union[
1085
+ None,
1086
+ Annotated[StrictFloat, Field(gt=0)],
1087
+ Tuple[
1088
+ Annotated[StrictFloat, Field(gt=0)],
1089
+ Annotated[StrictFloat, Field(gt=0)]
1090
+ ]
1091
+ ] = None,
1092
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1093
+ _content_type: Optional[StrictStr] = None,
1094
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1095
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1096
+ ) -> RESTResponseType:
1097
+ """Find Missing Source Path (synchronous)
1098
+
1099
+ Synchronous variant of :meth:`find_missing_source_path_api_import_find_missing_source_path_post_without_preload_content`. It calls
1100
+ the asynchronous method and blocks until it completes.
1101
+ """ # noqa: E501
1102
+ return run_sync(
1103
+ self.find_missing_source_path_api_import_find_missing_source_path_post_without_preload_content(
1104
+ find_missing_source_path_request=find_missing_source_path_request,
1105
+ _request_timeout=_request_timeout,
1106
+ _request_auth=_request_auth,
1107
+ _content_type=_content_type,
1108
+ _headers=_headers,
1109
+ _host_index=_host_index,
1110
+ )
1111
+ )
1112
+
1113
+
1114
+ def _find_missing_source_path_api_import_find_missing_source_path_post_serialize(
1115
+ self,
1116
+ find_missing_source_path_request,
1117
+ _request_auth,
1118
+ _content_type,
1119
+ _headers,
1120
+ _host_index,
1121
+ ) -> RequestSerialized:
1122
+
1123
+ _host = None
1124
+
1125
+ _collection_formats: Dict[str, str] = {
1126
+ }
1127
+
1128
+ _path_params: Dict[str, str] = {}
1129
+ _query_params: List[Tuple[str, str]] = []
1130
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1131
+ _form_params: List[Tuple[str, str]] = []
1132
+ _files: Dict[
1133
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1134
+ ] = {}
1135
+ _body_params: Optional[bytes] = None
1136
+
1137
+ # process the path parameters
1138
+ # process the query parameters
1139
+ # process the header parameters
1140
+ # process the form parameters
1141
+ # process the body parameter
1142
+ if find_missing_source_path_request is not None:
1143
+ _body_params = find_missing_source_path_request
1144
+
1145
+
1146
+ # set the HTTP header `Accept`
1147
+ if 'Accept' not in _header_params:
1148
+ _header_params['Accept'] = self.api_client.select_header_accept(
1149
+ [
1150
+ 'application/json'
1151
+ ]
1152
+ )
1153
+
1154
+ # set the HTTP header `Content-Type`
1155
+ if _content_type:
1156
+ _header_params['Content-Type'] = _content_type
1157
+ else:
1158
+ _default_content_type = (
1159
+ self.api_client.select_header_content_type(
1160
+ [
1161
+ 'application/json'
1162
+ ]
1163
+ )
1164
+ )
1165
+ if _default_content_type is not None:
1166
+ _header_params['Content-Type'] = _default_content_type
1167
+
1168
+ # authentication setting
1169
+ _auth_settings: List[str] = [
1170
+ ]
1171
+
1172
+ return self.api_client.param_serialize(
1173
+ method='POST',
1174
+ resource_path='/api/import/find_missing_source_path',
1175
+ path_params=_path_params,
1176
+ query_params=_query_params,
1177
+ header_params=_header_params,
1178
+ body=_body_params,
1179
+ post_params=_form_params,
1180
+ files=_files,
1181
+ auth_settings=_auth_settings,
1182
+ collection_formats=_collection_formats,
1183
+ _host=_host,
1184
+ _request_auth=_request_auth
1185
+ )
1186
+
1187
+
1188
+
1189
+
1190
+ @validate_call
1191
+ async def get_import_api_import_job_id_get(
1192
+ self,
1193
+ job_id: StrictStr,
1194
+ _request_timeout: Union[
1195
+ None,
1196
+ Annotated[StrictFloat, Field(gt=0)],
1197
+ Tuple[
1198
+ Annotated[StrictFloat, Field(gt=0)],
1199
+ Annotated[StrictFloat, Field(gt=0)]
1200
+ ]
1201
+ ] = None,
1202
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1203
+ _content_type: Optional[StrictStr] = None,
1204
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1205
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1206
+ ) -> ImportJob:
1207
+ """Get Import
1208
+
1209
+ Return a single import job (poll this for status / the pending decision).
1210
+
1211
+ :param job_id: (required)
1212
+ :type job_id: str
1213
+ :param _request_timeout: timeout setting for this request. If one
1214
+ number provided, it will be total request
1215
+ timeout. It can also be a pair (tuple) of
1216
+ (connection, read) timeouts.
1217
+ :type _request_timeout: int, tuple(int, int), optional
1218
+ :param _request_auth: set to override the auth_settings for an a single
1219
+ request; this effectively ignores the
1220
+ authentication in the spec for a single request.
1221
+ :type _request_auth: dict, optional
1222
+ :param _content_type: force content-type for the request.
1223
+ :type _content_type: str, Optional
1224
+ :param _headers: set to override the headers for a single
1225
+ request; this effectively ignores the headers
1226
+ in the spec for a single request.
1227
+ :type _headers: dict, optional
1228
+ :param _host_index: set to override the host_index for a single
1229
+ request; this effectively ignores the host_index
1230
+ in the spec for a single request.
1231
+ :type _host_index: int, optional
1232
+ :return: Returns the result object.
1233
+ """ # noqa: E501
1234
+
1235
+ _param = self._get_import_api_import_job_id_get_serialize(
1236
+ job_id=job_id,
1237
+ _request_auth=_request_auth,
1238
+ _content_type=_content_type,
1239
+ _headers=_headers,
1240
+ _host_index=_host_index
1241
+ )
1242
+
1243
+ _response_types_map: Dict[str, Optional[str]] = {
1244
+ '200': "ImportJob",
1245
+ '422': "HTTPValidationError",
1246
+ }
1247
+ response_data = await self.api_client.call_api(
1248
+ *_param,
1249
+ _request_timeout=_request_timeout
1250
+ )
1251
+ await response_data.read()
1252
+ return self.api_client.response_deserialize(
1253
+ response_data=response_data,
1254
+ response_types_map=_response_types_map,
1255
+ ).data
1256
+
1257
+
1258
+ @validate_call
1259
+ async def get_import_api_import_job_id_get_with_http_info(
1260
+ self,
1261
+ job_id: StrictStr,
1262
+ _request_timeout: Union[
1263
+ None,
1264
+ Annotated[StrictFloat, Field(gt=0)],
1265
+ Tuple[
1266
+ Annotated[StrictFloat, Field(gt=0)],
1267
+ Annotated[StrictFloat, Field(gt=0)]
1268
+ ]
1269
+ ] = None,
1270
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1271
+ _content_type: Optional[StrictStr] = None,
1272
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1273
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1274
+ ) -> ApiResponse[ImportJob]:
1275
+ """Get Import
1276
+
1277
+ Return a single import job (poll this for status / the pending decision).
1278
+
1279
+ :param job_id: (required)
1280
+ :type job_id: str
1281
+ :param _request_timeout: timeout setting for this request. If one
1282
+ number provided, it will be total request
1283
+ timeout. It can also be a pair (tuple) of
1284
+ (connection, read) timeouts.
1285
+ :type _request_timeout: int, tuple(int, int), optional
1286
+ :param _request_auth: set to override the auth_settings for an a single
1287
+ request; this effectively ignores the
1288
+ authentication in the spec for a single request.
1289
+ :type _request_auth: dict, optional
1290
+ :param _content_type: force content-type for the request.
1291
+ :type _content_type: str, Optional
1292
+ :param _headers: set to override the headers for a single
1293
+ request; this effectively ignores the headers
1294
+ in the spec for a single request.
1295
+ :type _headers: dict, optional
1296
+ :param _host_index: set to override the host_index for a single
1297
+ request; this effectively ignores the host_index
1298
+ in the spec for a single request.
1299
+ :type _host_index: int, optional
1300
+ :return: Returns the result object.
1301
+ """ # noqa: E501
1302
+
1303
+ _param = self._get_import_api_import_job_id_get_serialize(
1304
+ job_id=job_id,
1305
+ _request_auth=_request_auth,
1306
+ _content_type=_content_type,
1307
+ _headers=_headers,
1308
+ _host_index=_host_index
1309
+ )
1310
+
1311
+ _response_types_map: Dict[str, Optional[str]] = {
1312
+ '200': "ImportJob",
1313
+ '422': "HTTPValidationError",
1314
+ }
1315
+ response_data = await self.api_client.call_api(
1316
+ *_param,
1317
+ _request_timeout=_request_timeout
1318
+ )
1319
+ await response_data.read()
1320
+ return self.api_client.response_deserialize(
1321
+ response_data=response_data,
1322
+ response_types_map=_response_types_map,
1323
+ )
1324
+
1325
+
1326
+ @validate_call
1327
+ async def get_import_api_import_job_id_get_without_preload_content(
1328
+ self,
1329
+ job_id: StrictStr,
1330
+ _request_timeout: Union[
1331
+ None,
1332
+ Annotated[StrictFloat, Field(gt=0)],
1333
+ Tuple[
1334
+ Annotated[StrictFloat, Field(gt=0)],
1335
+ Annotated[StrictFloat, Field(gt=0)]
1336
+ ]
1337
+ ] = None,
1338
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1339
+ _content_type: Optional[StrictStr] = None,
1340
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1341
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1342
+ ) -> RESTResponseType:
1343
+ """Get Import
1344
+
1345
+ Return a single import job (poll this for status / the pending decision).
1346
+
1347
+ :param job_id: (required)
1348
+ :type job_id: str
1349
+ :param _request_timeout: timeout setting for this request. If one
1350
+ number provided, it will be total request
1351
+ timeout. It can also be a pair (tuple) of
1352
+ (connection, read) timeouts.
1353
+ :type _request_timeout: int, tuple(int, int), optional
1354
+ :param _request_auth: set to override the auth_settings for an a single
1355
+ request; this effectively ignores the
1356
+ authentication in the spec for a single request.
1357
+ :type _request_auth: dict, optional
1358
+ :param _content_type: force content-type for the request.
1359
+ :type _content_type: str, Optional
1360
+ :param _headers: set to override the headers for a single
1361
+ request; this effectively ignores the headers
1362
+ in the spec for a single request.
1363
+ :type _headers: dict, optional
1364
+ :param _host_index: set to override the host_index for a single
1365
+ request; this effectively ignores the host_index
1366
+ in the spec for a single request.
1367
+ :type _host_index: int, optional
1368
+ :return: Returns the result object.
1369
+ """ # noqa: E501
1370
+
1371
+ _param = self._get_import_api_import_job_id_get_serialize(
1372
+ job_id=job_id,
1373
+ _request_auth=_request_auth,
1374
+ _content_type=_content_type,
1375
+ _headers=_headers,
1376
+ _host_index=_host_index
1377
+ )
1378
+
1379
+ _response_types_map: Dict[str, Optional[str]] = {
1380
+ '200': "ImportJob",
1381
+ '422': "HTTPValidationError",
1382
+ }
1383
+ response_data = await self.api_client.call_api(
1384
+ *_param,
1385
+ _request_timeout=_request_timeout
1386
+ )
1387
+ return response_data.response
1388
+
1389
+
1390
+ @validate_call
1391
+ def get_import_api_import_job_id_get_sync(
1392
+ self,
1393
+ job_id: StrictStr,
1394
+ _request_timeout: Union[
1395
+ None,
1396
+ Annotated[StrictFloat, Field(gt=0)],
1397
+ Tuple[
1398
+ Annotated[StrictFloat, Field(gt=0)],
1399
+ Annotated[StrictFloat, Field(gt=0)]
1400
+ ]
1401
+ ] = None,
1402
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1403
+ _content_type: Optional[StrictStr] = None,
1404
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1405
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1406
+ ) -> ImportJob:
1407
+ """Get Import (synchronous)
1408
+
1409
+ Synchronous variant of :meth:`get_import_api_import_job_id_get`. It calls the asynchronous
1410
+ method and blocks until it completes.
1411
+ """ # noqa: E501
1412
+ return run_sync(
1413
+ self.get_import_api_import_job_id_get(
1414
+ job_id=job_id,
1415
+ _request_timeout=_request_timeout,
1416
+ _request_auth=_request_auth,
1417
+ _content_type=_content_type,
1418
+ _headers=_headers,
1419
+ _host_index=_host_index,
1420
+ )
1421
+ )
1422
+
1423
+
1424
+ @validate_call
1425
+ def get_import_api_import_job_id_get_sync_with_http_info(
1426
+ self,
1427
+ job_id: StrictStr,
1428
+ _request_timeout: Union[
1429
+ None,
1430
+ Annotated[StrictFloat, Field(gt=0)],
1431
+ Tuple[
1432
+ Annotated[StrictFloat, Field(gt=0)],
1433
+ Annotated[StrictFloat, Field(gt=0)]
1434
+ ]
1435
+ ] = None,
1436
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1437
+ _content_type: Optional[StrictStr] = None,
1438
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1439
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1440
+ ) -> ApiResponse[ImportJob]:
1441
+ """Get Import (synchronous)
1442
+
1443
+ Synchronous variant of :meth:`get_import_api_import_job_id_get_with_http_info`. It calls the
1444
+ asynchronous method and blocks until it completes.
1445
+ """ # noqa: E501
1446
+ return run_sync(
1447
+ self.get_import_api_import_job_id_get_with_http_info(
1448
+ job_id=job_id,
1449
+ _request_timeout=_request_timeout,
1450
+ _request_auth=_request_auth,
1451
+ _content_type=_content_type,
1452
+ _headers=_headers,
1453
+ _host_index=_host_index,
1454
+ )
1455
+ )
1456
+
1457
+
1458
+ @validate_call
1459
+ def get_import_api_import_job_id_get_sync_without_preload_content(
1460
+ self,
1461
+ job_id: StrictStr,
1462
+ _request_timeout: Union[
1463
+ None,
1464
+ Annotated[StrictFloat, Field(gt=0)],
1465
+ Tuple[
1466
+ Annotated[StrictFloat, Field(gt=0)],
1467
+ Annotated[StrictFloat, Field(gt=0)]
1468
+ ]
1469
+ ] = None,
1470
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1471
+ _content_type: Optional[StrictStr] = None,
1472
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1473
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1474
+ ) -> RESTResponseType:
1475
+ """Get Import (synchronous)
1476
+
1477
+ Synchronous variant of :meth:`get_import_api_import_job_id_get_without_preload_content`. It calls
1478
+ the asynchronous method and blocks until it completes.
1479
+ """ # noqa: E501
1480
+ return run_sync(
1481
+ self.get_import_api_import_job_id_get_without_preload_content(
1482
+ job_id=job_id,
1483
+ _request_timeout=_request_timeout,
1484
+ _request_auth=_request_auth,
1485
+ _content_type=_content_type,
1486
+ _headers=_headers,
1487
+ _host_index=_host_index,
1488
+ )
1489
+ )
1490
+
1491
+
1492
+ def _get_import_api_import_job_id_get_serialize(
1493
+ self,
1494
+ job_id,
1495
+ _request_auth,
1496
+ _content_type,
1497
+ _headers,
1498
+ _host_index,
1499
+ ) -> RequestSerialized:
1500
+
1501
+ _host = None
1502
+
1503
+ _collection_formats: Dict[str, str] = {
1504
+ }
1505
+
1506
+ _path_params: Dict[str, str] = {}
1507
+ _query_params: List[Tuple[str, str]] = []
1508
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1509
+ _form_params: List[Tuple[str, str]] = []
1510
+ _files: Dict[
1511
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1512
+ ] = {}
1513
+ _body_params: Optional[bytes] = None
1514
+
1515
+ # process the path parameters
1516
+ if job_id is not None:
1517
+ _path_params['job_id'] = job_id
1518
+ # process the query parameters
1519
+ # process the header parameters
1520
+ # process the form parameters
1521
+ # process the body parameter
1522
+
1523
+
1524
+ # set the HTTP header `Accept`
1525
+ if 'Accept' not in _header_params:
1526
+ _header_params['Accept'] = self.api_client.select_header_accept(
1527
+ [
1528
+ 'application/json'
1529
+ ]
1530
+ )
1531
+
1532
+
1533
+ # authentication setting
1534
+ _auth_settings: List[str] = [
1535
+ ]
1536
+
1537
+ return self.api_client.param_serialize(
1538
+ method='GET',
1539
+ resource_path='/api/import/{job_id}',
1540
+ path_params=_path_params,
1541
+ query_params=_query_params,
1542
+ header_params=_header_params,
1543
+ body=_body_params,
1544
+ post_params=_form_params,
1545
+ files=_files,
1546
+ auth_settings=_auth_settings,
1547
+ collection_formats=_collection_formats,
1548
+ _host=_host,
1549
+ _request_auth=_request_auth
1550
+ )
1551
+
1552
+
1553
+
1554
+
1555
+ @validate_call
1556
+ async def list_imports_api_import_get(
1557
+ self,
1558
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
1559
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
1560
+ _request_timeout: Union[
1561
+ None,
1562
+ Annotated[StrictFloat, Field(gt=0)],
1563
+ Tuple[
1564
+ Annotated[StrictFloat, Field(gt=0)],
1565
+ Annotated[StrictFloat, Field(gt=0)]
1566
+ ]
1567
+ ] = None,
1568
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1569
+ _content_type: Optional[StrictStr] = None,
1570
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1571
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1572
+ ) -> List[ImportJob]:
1573
+ """List Imports
1574
+
1575
+ List one page of known import jobs, newest first (so page 1 shows the most recent submissions).
1576
+
1577
+ :param page: The page number, 1-indexed.
1578
+ :type page: int
1579
+ :param page_size: Maximum results per page.
1580
+ :type page_size: int
1581
+ :param _request_timeout: timeout setting for this request. If one
1582
+ number provided, it will be total request
1583
+ timeout. It can also be a pair (tuple) of
1584
+ (connection, read) timeouts.
1585
+ :type _request_timeout: int, tuple(int, int), optional
1586
+ :param _request_auth: set to override the auth_settings for an a single
1587
+ request; this effectively ignores the
1588
+ authentication in the spec for a single request.
1589
+ :type _request_auth: dict, optional
1590
+ :param _content_type: force content-type for the request.
1591
+ :type _content_type: str, Optional
1592
+ :param _headers: set to override the headers for a single
1593
+ request; this effectively ignores the headers
1594
+ in the spec for a single request.
1595
+ :type _headers: dict, optional
1596
+ :param _host_index: set to override the host_index for a single
1597
+ request; this effectively ignores the host_index
1598
+ in the spec for a single request.
1599
+ :type _host_index: int, optional
1600
+ :return: Returns the result object.
1601
+ """ # noqa: E501
1602
+
1603
+ _param = self._list_imports_api_import_get_serialize(
1604
+ page=page,
1605
+ page_size=page_size,
1606
+ _request_auth=_request_auth,
1607
+ _content_type=_content_type,
1608
+ _headers=_headers,
1609
+ _host_index=_host_index
1610
+ )
1611
+
1612
+ _response_types_map: Dict[str, Optional[str]] = {
1613
+ '200': "List[ImportJob]",
1614
+ '422': "HTTPValidationError",
1615
+ }
1616
+ response_data = await self.api_client.call_api(
1617
+ *_param,
1618
+ _request_timeout=_request_timeout
1619
+ )
1620
+ await response_data.read()
1621
+ return self.api_client.response_deserialize(
1622
+ response_data=response_data,
1623
+ response_types_map=_response_types_map,
1624
+ ).data
1625
+
1626
+
1627
+ @validate_call
1628
+ async def list_imports_api_import_get_with_http_info(
1629
+ self,
1630
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
1631
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
1632
+ _request_timeout: Union[
1633
+ None,
1634
+ Annotated[StrictFloat, Field(gt=0)],
1635
+ Tuple[
1636
+ Annotated[StrictFloat, Field(gt=0)],
1637
+ Annotated[StrictFloat, Field(gt=0)]
1638
+ ]
1639
+ ] = None,
1640
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1641
+ _content_type: Optional[StrictStr] = None,
1642
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1643
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1644
+ ) -> ApiResponse[List[ImportJob]]:
1645
+ """List Imports
1646
+
1647
+ List one page of known import jobs, newest first (so page 1 shows the most recent submissions).
1648
+
1649
+ :param page: The page number, 1-indexed.
1650
+ :type page: int
1651
+ :param page_size: Maximum results per page.
1652
+ :type page_size: int
1653
+ :param _request_timeout: timeout setting for this request. If one
1654
+ number provided, it will be total request
1655
+ timeout. It can also be a pair (tuple) of
1656
+ (connection, read) timeouts.
1657
+ :type _request_timeout: int, tuple(int, int), optional
1658
+ :param _request_auth: set to override the auth_settings for an a single
1659
+ request; this effectively ignores the
1660
+ authentication in the spec for a single request.
1661
+ :type _request_auth: dict, optional
1662
+ :param _content_type: force content-type for the request.
1663
+ :type _content_type: str, Optional
1664
+ :param _headers: set to override the headers for a single
1665
+ request; this effectively ignores the headers
1666
+ in the spec for a single request.
1667
+ :type _headers: dict, optional
1668
+ :param _host_index: set to override the host_index for a single
1669
+ request; this effectively ignores the host_index
1670
+ in the spec for a single request.
1671
+ :type _host_index: int, optional
1672
+ :return: Returns the result object.
1673
+ """ # noqa: E501
1674
+
1675
+ _param = self._list_imports_api_import_get_serialize(
1676
+ page=page,
1677
+ page_size=page_size,
1678
+ _request_auth=_request_auth,
1679
+ _content_type=_content_type,
1680
+ _headers=_headers,
1681
+ _host_index=_host_index
1682
+ )
1683
+
1684
+ _response_types_map: Dict[str, Optional[str]] = {
1685
+ '200': "List[ImportJob]",
1686
+ '422': "HTTPValidationError",
1687
+ }
1688
+ response_data = await self.api_client.call_api(
1689
+ *_param,
1690
+ _request_timeout=_request_timeout
1691
+ )
1692
+ await response_data.read()
1693
+ return self.api_client.response_deserialize(
1694
+ response_data=response_data,
1695
+ response_types_map=_response_types_map,
1696
+ )
1697
+
1698
+
1699
+ @validate_call
1700
+ async def list_imports_api_import_get_without_preload_content(
1701
+ self,
1702
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
1703
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
1704
+ _request_timeout: Union[
1705
+ None,
1706
+ Annotated[StrictFloat, Field(gt=0)],
1707
+ Tuple[
1708
+ Annotated[StrictFloat, Field(gt=0)],
1709
+ Annotated[StrictFloat, Field(gt=0)]
1710
+ ]
1711
+ ] = None,
1712
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1713
+ _content_type: Optional[StrictStr] = None,
1714
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1715
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1716
+ ) -> RESTResponseType:
1717
+ """List Imports
1718
+
1719
+ List one page of known import jobs, newest first (so page 1 shows the most recent submissions).
1720
+
1721
+ :param page: The page number, 1-indexed.
1722
+ :type page: int
1723
+ :param page_size: Maximum results per page.
1724
+ :type page_size: int
1725
+ :param _request_timeout: timeout setting for this request. If one
1726
+ number provided, it will be total request
1727
+ timeout. It can also be a pair (tuple) of
1728
+ (connection, read) timeouts.
1729
+ :type _request_timeout: int, tuple(int, int), optional
1730
+ :param _request_auth: set to override the auth_settings for an a single
1731
+ request; this effectively ignores the
1732
+ authentication in the spec for a single request.
1733
+ :type _request_auth: dict, optional
1734
+ :param _content_type: force content-type for the request.
1735
+ :type _content_type: str, Optional
1736
+ :param _headers: set to override the headers for a single
1737
+ request; this effectively ignores the headers
1738
+ in the spec for a single request.
1739
+ :type _headers: dict, optional
1740
+ :param _host_index: set to override the host_index for a single
1741
+ request; this effectively ignores the host_index
1742
+ in the spec for a single request.
1743
+ :type _host_index: int, optional
1744
+ :return: Returns the result object.
1745
+ """ # noqa: E501
1746
+
1747
+ _param = self._list_imports_api_import_get_serialize(
1748
+ page=page,
1749
+ page_size=page_size,
1750
+ _request_auth=_request_auth,
1751
+ _content_type=_content_type,
1752
+ _headers=_headers,
1753
+ _host_index=_host_index
1754
+ )
1755
+
1756
+ _response_types_map: Dict[str, Optional[str]] = {
1757
+ '200': "List[ImportJob]",
1758
+ '422': "HTTPValidationError",
1759
+ }
1760
+ response_data = await self.api_client.call_api(
1761
+ *_param,
1762
+ _request_timeout=_request_timeout
1763
+ )
1764
+ return response_data.response
1765
+
1766
+
1767
+ @validate_call
1768
+ def list_imports_api_import_get_sync(
1769
+ self,
1770
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
1771
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
1772
+ _request_timeout: Union[
1773
+ None,
1774
+ Annotated[StrictFloat, Field(gt=0)],
1775
+ Tuple[
1776
+ Annotated[StrictFloat, Field(gt=0)],
1777
+ Annotated[StrictFloat, Field(gt=0)]
1778
+ ]
1779
+ ] = None,
1780
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1781
+ _content_type: Optional[StrictStr] = None,
1782
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1783
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1784
+ ) -> List[ImportJob]:
1785
+ """List Imports (synchronous)
1786
+
1787
+ Synchronous variant of :meth:`list_imports_api_import_get`. It calls the asynchronous
1788
+ method and blocks until it completes.
1789
+ """ # noqa: E501
1790
+ return run_sync(
1791
+ self.list_imports_api_import_get(
1792
+ page=page,
1793
+ page_size=page_size,
1794
+ _request_timeout=_request_timeout,
1795
+ _request_auth=_request_auth,
1796
+ _content_type=_content_type,
1797
+ _headers=_headers,
1798
+ _host_index=_host_index,
1799
+ )
1800
+ )
1801
+
1802
+
1803
+ @validate_call
1804
+ def list_imports_api_import_get_sync_with_http_info(
1805
+ self,
1806
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
1807
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
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
+ ) -> ApiResponse[List[ImportJob]]:
1821
+ """List Imports (synchronous)
1822
+
1823
+ Synchronous variant of :meth:`list_imports_api_import_get_with_http_info`. It calls the
1824
+ asynchronous method and blocks until it completes.
1825
+ """ # noqa: E501
1826
+ return run_sync(
1827
+ self.list_imports_api_import_get_with_http_info(
1828
+ page=page,
1829
+ page_size=page_size,
1830
+ _request_timeout=_request_timeout,
1831
+ _request_auth=_request_auth,
1832
+ _content_type=_content_type,
1833
+ _headers=_headers,
1834
+ _host_index=_host_index,
1835
+ )
1836
+ )
1837
+
1838
+
1839
+ @validate_call
1840
+ def list_imports_api_import_get_sync_without_preload_content(
1841
+ self,
1842
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
1843
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
1844
+ _request_timeout: Union[
1845
+ None,
1846
+ Annotated[StrictFloat, Field(gt=0)],
1847
+ Tuple[
1848
+ Annotated[StrictFloat, Field(gt=0)],
1849
+ Annotated[StrictFloat, Field(gt=0)]
1850
+ ]
1851
+ ] = None,
1852
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1853
+ _content_type: Optional[StrictStr] = None,
1854
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1855
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1856
+ ) -> RESTResponseType:
1857
+ """List Imports (synchronous)
1858
+
1859
+ Synchronous variant of :meth:`list_imports_api_import_get_without_preload_content`. It calls
1860
+ the asynchronous method and blocks until it completes.
1861
+ """ # noqa: E501
1862
+ return run_sync(
1863
+ self.list_imports_api_import_get_without_preload_content(
1864
+ page=page,
1865
+ page_size=page_size,
1866
+ _request_timeout=_request_timeout,
1867
+ _request_auth=_request_auth,
1868
+ _content_type=_content_type,
1869
+ _headers=_headers,
1870
+ _host_index=_host_index,
1871
+ )
1872
+ )
1873
+
1874
+
1875
+ def _list_imports_api_import_get_serialize(
1876
+ self,
1877
+ page,
1878
+ page_size,
1879
+ _request_auth,
1880
+ _content_type,
1881
+ _headers,
1882
+ _host_index,
1883
+ ) -> RequestSerialized:
1884
+
1885
+ _host = None
1886
+
1887
+ _collection_formats: Dict[str, str] = {
1888
+ }
1889
+
1890
+ _path_params: Dict[str, str] = {}
1891
+ _query_params: List[Tuple[str, str]] = []
1892
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1893
+ _form_params: List[Tuple[str, str]] = []
1894
+ _files: Dict[
1895
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1896
+ ] = {}
1897
+ _body_params: Optional[bytes] = None
1898
+
1899
+ # process the path parameters
1900
+ # process the query parameters
1901
+ if page is not None:
1902
+
1903
+ _query_params.append(('page', page))
1904
+
1905
+ if page_size is not None:
1906
+
1907
+ _query_params.append(('page_size', page_size))
1908
+
1909
+ # process the header parameters
1910
+ # process the form parameters
1911
+ # process the body parameter
1912
+
1913
+
1914
+ # set the HTTP header `Accept`
1915
+ if 'Accept' not in _header_params:
1916
+ _header_params['Accept'] = self.api_client.select_header_accept(
1917
+ [
1918
+ 'application/json'
1919
+ ]
1920
+ )
1921
+
1922
+
1923
+ # authentication setting
1924
+ _auth_settings: List[str] = [
1925
+ ]
1926
+
1927
+ return self.api_client.param_serialize(
1928
+ method='GET',
1929
+ resource_path='/api/import',
1930
+ path_params=_path_params,
1931
+ query_params=_query_params,
1932
+ header_params=_header_params,
1933
+ body=_body_params,
1934
+ post_params=_form_params,
1935
+ files=_files,
1936
+ auth_settings=_auth_settings,
1937
+ collection_formats=_collection_formats,
1938
+ _host=_host,
1939
+ _request_auth=_request_auth
1940
+ )
1941
+
1942
+
1943
+
1944
+
1945
+ @validate_call
1946
+ async def preview_clean_slate_api_import_clean_slate_preview_get(
1947
+ self,
1948
+ source_path: Annotated[str, Field(min_length=1, strict=True, description="The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file.")],
1949
+ beets_album_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an album. Mutually exclusive with `beets_item_id`.")] = None,
1950
+ beets_item_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an item (track). Mutually exclusive with `beets_album_id`.")] = None,
1951
+ allow_fewer_files: Annotated[Optional[StrictBool], Field(description="Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.")] = None,
1952
+ _request_timeout: Union[
1953
+ None,
1954
+ Annotated[StrictFloat, Field(gt=0)],
1955
+ Tuple[
1956
+ Annotated[StrictFloat, Field(gt=0)],
1957
+ Annotated[StrictFloat, Field(gt=0)]
1958
+ ]
1959
+ ] = None,
1960
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1961
+ _content_type: Optional[StrictStr] = None,
1962
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1963
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1964
+ ) -> CleanSlatePreview:
1965
+ """Preview Clean Slate
1966
+
1967
+ Dry-run a clean-slate import without touching anything (see `POST /api/import/clean_slate`). Reports what the removal would delete (library files inside the beets directory, album art), what it would leave alone, the flexible attributes that would be lost and those re-applied to the fresh import (`fields_preserved`: the entry's values for the keys of the `downloader_hook.beet_field_to_dl_search_field` config), what the source folder holds, plus the blocking `errors`, non-blocking `warnings`, and whether the fewer-files opt-in is needed. 404 for an unknown beets id.
1968
+
1969
+ :param source_path: The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file. (required)
1970
+ :type source_path: str
1971
+ :param beets_album_id: The beets library id of an album. Mutually exclusive with `beets_item_id`.
1972
+ :type beets_album_id: int
1973
+ :param beets_item_id: The beets library id of an item (track). Mutually exclusive with `beets_album_id`.
1974
+ :type beets_item_id: int
1975
+ :param allow_fewer_files: Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.
1976
+ :type allow_fewer_files: bool
1977
+ :param _request_timeout: timeout setting for this request. If one
1978
+ number provided, it will be total request
1979
+ timeout. It can also be a pair (tuple) of
1980
+ (connection, read) timeouts.
1981
+ :type _request_timeout: int, tuple(int, int), optional
1982
+ :param _request_auth: set to override the auth_settings for an a single
1983
+ request; this effectively ignores the
1984
+ authentication in the spec for a single request.
1985
+ :type _request_auth: dict, optional
1986
+ :param _content_type: force content-type for the request.
1987
+ :type _content_type: str, Optional
1988
+ :param _headers: set to override the headers for a single
1989
+ request; this effectively ignores the headers
1990
+ in the spec for a single request.
1991
+ :type _headers: dict, optional
1992
+ :param _host_index: set to override the host_index for a single
1993
+ request; this effectively ignores the host_index
1994
+ in the spec for a single request.
1995
+ :type _host_index: int, optional
1996
+ :return: Returns the result object.
1997
+ """ # noqa: E501
1998
+
1999
+ _param = self._preview_clean_slate_api_import_clean_slate_preview_get_serialize(
2000
+ source_path=source_path,
2001
+ beets_album_id=beets_album_id,
2002
+ beets_item_id=beets_item_id,
2003
+ allow_fewer_files=allow_fewer_files,
2004
+ _request_auth=_request_auth,
2005
+ _content_type=_content_type,
2006
+ _headers=_headers,
2007
+ _host_index=_host_index
2008
+ )
2009
+
2010
+ _response_types_map: Dict[str, Optional[str]] = {
2011
+ '200': "CleanSlatePreview",
2012
+ '422': "HTTPValidationError",
2013
+ }
2014
+ response_data = await self.api_client.call_api(
2015
+ *_param,
2016
+ _request_timeout=_request_timeout
2017
+ )
2018
+ await response_data.read()
2019
+ return self.api_client.response_deserialize(
2020
+ response_data=response_data,
2021
+ response_types_map=_response_types_map,
2022
+ ).data
2023
+
2024
+
2025
+ @validate_call
2026
+ async def preview_clean_slate_api_import_clean_slate_preview_get_with_http_info(
2027
+ self,
2028
+ source_path: Annotated[str, Field(min_length=1, strict=True, description="The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file.")],
2029
+ beets_album_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an album. Mutually exclusive with `beets_item_id`.")] = None,
2030
+ beets_item_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an item (track). Mutually exclusive with `beets_album_id`.")] = None,
2031
+ allow_fewer_files: Annotated[Optional[StrictBool], Field(description="Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.")] = None,
2032
+ _request_timeout: Union[
2033
+ None,
2034
+ Annotated[StrictFloat, Field(gt=0)],
2035
+ Tuple[
2036
+ Annotated[StrictFloat, Field(gt=0)],
2037
+ Annotated[StrictFloat, Field(gt=0)]
2038
+ ]
2039
+ ] = None,
2040
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2041
+ _content_type: Optional[StrictStr] = None,
2042
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2043
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2044
+ ) -> ApiResponse[CleanSlatePreview]:
2045
+ """Preview Clean Slate
2046
+
2047
+ Dry-run a clean-slate import without touching anything (see `POST /api/import/clean_slate`). Reports what the removal would delete (library files inside the beets directory, album art), what it would leave alone, the flexible attributes that would be lost and those re-applied to the fresh import (`fields_preserved`: the entry's values for the keys of the `downloader_hook.beet_field_to_dl_search_field` config), what the source folder holds, plus the blocking `errors`, non-blocking `warnings`, and whether the fewer-files opt-in is needed. 404 for an unknown beets id.
2048
+
2049
+ :param source_path: The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file. (required)
2050
+ :type source_path: str
2051
+ :param beets_album_id: The beets library id of an album. Mutually exclusive with `beets_item_id`.
2052
+ :type beets_album_id: int
2053
+ :param beets_item_id: The beets library id of an item (track). Mutually exclusive with `beets_album_id`.
2054
+ :type beets_item_id: int
2055
+ :param allow_fewer_files: Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.
2056
+ :type allow_fewer_files: bool
2057
+ :param _request_timeout: timeout setting for this request. If one
2058
+ number provided, it will be total request
2059
+ timeout. It can also be a pair (tuple) of
2060
+ (connection, read) timeouts.
2061
+ :type _request_timeout: int, tuple(int, int), optional
2062
+ :param _request_auth: set to override the auth_settings for an a single
2063
+ request; this effectively ignores the
2064
+ authentication in the spec for a single request.
2065
+ :type _request_auth: dict, optional
2066
+ :param _content_type: force content-type for the request.
2067
+ :type _content_type: str, Optional
2068
+ :param _headers: set to override the headers for a single
2069
+ request; this effectively ignores the headers
2070
+ in the spec for a single request.
2071
+ :type _headers: dict, optional
2072
+ :param _host_index: set to override the host_index for a single
2073
+ request; this effectively ignores the host_index
2074
+ in the spec for a single request.
2075
+ :type _host_index: int, optional
2076
+ :return: Returns the result object.
2077
+ """ # noqa: E501
2078
+
2079
+ _param = self._preview_clean_slate_api_import_clean_slate_preview_get_serialize(
2080
+ source_path=source_path,
2081
+ beets_album_id=beets_album_id,
2082
+ beets_item_id=beets_item_id,
2083
+ allow_fewer_files=allow_fewer_files,
2084
+ _request_auth=_request_auth,
2085
+ _content_type=_content_type,
2086
+ _headers=_headers,
2087
+ _host_index=_host_index
2088
+ )
2089
+
2090
+ _response_types_map: Dict[str, Optional[str]] = {
2091
+ '200': "CleanSlatePreview",
2092
+ '422': "HTTPValidationError",
2093
+ }
2094
+ response_data = await self.api_client.call_api(
2095
+ *_param,
2096
+ _request_timeout=_request_timeout
2097
+ )
2098
+ await response_data.read()
2099
+ return self.api_client.response_deserialize(
2100
+ response_data=response_data,
2101
+ response_types_map=_response_types_map,
2102
+ )
2103
+
2104
+
2105
+ @validate_call
2106
+ async def preview_clean_slate_api_import_clean_slate_preview_get_without_preload_content(
2107
+ self,
2108
+ source_path: Annotated[str, Field(min_length=1, strict=True, description="The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file.")],
2109
+ beets_album_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an album. Mutually exclusive with `beets_item_id`.")] = None,
2110
+ beets_item_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an item (track). Mutually exclusive with `beets_album_id`.")] = None,
2111
+ allow_fewer_files: Annotated[Optional[StrictBool], Field(description="Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.")] = None,
2112
+ _request_timeout: Union[
2113
+ None,
2114
+ Annotated[StrictFloat, Field(gt=0)],
2115
+ Tuple[
2116
+ Annotated[StrictFloat, Field(gt=0)],
2117
+ Annotated[StrictFloat, Field(gt=0)]
2118
+ ]
2119
+ ] = None,
2120
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2121
+ _content_type: Optional[StrictStr] = None,
2122
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2123
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2124
+ ) -> RESTResponseType:
2125
+ """Preview Clean Slate
2126
+
2127
+ Dry-run a clean-slate import without touching anything (see `POST /api/import/clean_slate`). Reports what the removal would delete (library files inside the beets directory, album art), what it would leave alone, the flexible attributes that would be lost and those re-applied to the fresh import (`fields_preserved`: the entry's values for the keys of the `downloader_hook.beet_field_to_dl_search_field` config), what the source folder holds, plus the blocking `errors`, non-blocking `warnings`, and whether the fewer-files opt-in is needed. 404 for an unknown beets id.
2128
+
2129
+ :param source_path: The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file. (required)
2130
+ :type source_path: str
2131
+ :param beets_album_id: The beets library id of an album. Mutually exclusive with `beets_item_id`.
2132
+ :type beets_album_id: int
2133
+ :param beets_item_id: The beets library id of an item (track). Mutually exclusive with `beets_album_id`.
2134
+ :type beets_item_id: int
2135
+ :param allow_fewer_files: Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.
2136
+ :type allow_fewer_files: bool
2137
+ :param _request_timeout: timeout setting for this request. If one
2138
+ number provided, it will be total request
2139
+ timeout. It can also be a pair (tuple) of
2140
+ (connection, read) timeouts.
2141
+ :type _request_timeout: int, tuple(int, int), optional
2142
+ :param _request_auth: set to override the auth_settings for an a single
2143
+ request; this effectively ignores the
2144
+ authentication in the spec for a single request.
2145
+ :type _request_auth: dict, optional
2146
+ :param _content_type: force content-type for the request.
2147
+ :type _content_type: str, Optional
2148
+ :param _headers: set to override the headers for a single
2149
+ request; this effectively ignores the headers
2150
+ in the spec for a single request.
2151
+ :type _headers: dict, optional
2152
+ :param _host_index: set to override the host_index for a single
2153
+ request; this effectively ignores the host_index
2154
+ in the spec for a single request.
2155
+ :type _host_index: int, optional
2156
+ :return: Returns the result object.
2157
+ """ # noqa: E501
2158
+
2159
+ _param = self._preview_clean_slate_api_import_clean_slate_preview_get_serialize(
2160
+ source_path=source_path,
2161
+ beets_album_id=beets_album_id,
2162
+ beets_item_id=beets_item_id,
2163
+ allow_fewer_files=allow_fewer_files,
2164
+ _request_auth=_request_auth,
2165
+ _content_type=_content_type,
2166
+ _headers=_headers,
2167
+ _host_index=_host_index
2168
+ )
2169
+
2170
+ _response_types_map: Dict[str, Optional[str]] = {
2171
+ '200': "CleanSlatePreview",
2172
+ '422': "HTTPValidationError",
2173
+ }
2174
+ response_data = await self.api_client.call_api(
2175
+ *_param,
2176
+ _request_timeout=_request_timeout
2177
+ )
2178
+ return response_data.response
2179
+
2180
+
2181
+ @validate_call
2182
+ def preview_clean_slate_api_import_clean_slate_preview_get_sync(
2183
+ self,
2184
+ source_path: Annotated[str, Field(min_length=1, strict=True, description="The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file.")],
2185
+ beets_album_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an album. Mutually exclusive with `beets_item_id`.")] = None,
2186
+ beets_item_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an item (track). Mutually exclusive with `beets_album_id`.")] = None,
2187
+ allow_fewer_files: Annotated[Optional[StrictBool], Field(description="Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.")] = None,
2188
+ _request_timeout: Union[
2189
+ None,
2190
+ Annotated[StrictFloat, Field(gt=0)],
2191
+ Tuple[
2192
+ Annotated[StrictFloat, Field(gt=0)],
2193
+ Annotated[StrictFloat, Field(gt=0)]
2194
+ ]
2195
+ ] = None,
2196
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2197
+ _content_type: Optional[StrictStr] = None,
2198
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2199
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2200
+ ) -> CleanSlatePreview:
2201
+ """Preview Clean Slate (synchronous)
2202
+
2203
+ Synchronous variant of :meth:`preview_clean_slate_api_import_clean_slate_preview_get`. It calls the asynchronous
2204
+ method and blocks until it completes.
2205
+ """ # noqa: E501
2206
+ return run_sync(
2207
+ self.preview_clean_slate_api_import_clean_slate_preview_get(
2208
+ source_path=source_path,
2209
+ beets_album_id=beets_album_id,
2210
+ beets_item_id=beets_item_id,
2211
+ allow_fewer_files=allow_fewer_files,
2212
+ _request_timeout=_request_timeout,
2213
+ _request_auth=_request_auth,
2214
+ _content_type=_content_type,
2215
+ _headers=_headers,
2216
+ _host_index=_host_index,
2217
+ )
2218
+ )
2219
+
2220
+
2221
+ @validate_call
2222
+ def preview_clean_slate_api_import_clean_slate_preview_get_sync_with_http_info(
2223
+ self,
2224
+ source_path: Annotated[str, Field(min_length=1, strict=True, description="The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file.")],
2225
+ beets_album_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an album. Mutually exclusive with `beets_item_id`.")] = None,
2226
+ beets_item_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an item (track). Mutually exclusive with `beets_album_id`.")] = None,
2227
+ allow_fewer_files: Annotated[Optional[StrictBool], Field(description="Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.")] = None,
2228
+ _request_timeout: Union[
2229
+ None,
2230
+ Annotated[StrictFloat, Field(gt=0)],
2231
+ Tuple[
2232
+ Annotated[StrictFloat, Field(gt=0)],
2233
+ Annotated[StrictFloat, Field(gt=0)]
2234
+ ]
2235
+ ] = None,
2236
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2237
+ _content_type: Optional[StrictStr] = None,
2238
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2239
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2240
+ ) -> ApiResponse[CleanSlatePreview]:
2241
+ """Preview Clean Slate (synchronous)
2242
+
2243
+ Synchronous variant of :meth:`preview_clean_slate_api_import_clean_slate_preview_get_with_http_info`. It calls the
2244
+ asynchronous method and blocks until it completes.
2245
+ """ # noqa: E501
2246
+ return run_sync(
2247
+ self.preview_clean_slate_api_import_clean_slate_preview_get_with_http_info(
2248
+ source_path=source_path,
2249
+ beets_album_id=beets_album_id,
2250
+ beets_item_id=beets_item_id,
2251
+ allow_fewer_files=allow_fewer_files,
2252
+ _request_timeout=_request_timeout,
2253
+ _request_auth=_request_auth,
2254
+ _content_type=_content_type,
2255
+ _headers=_headers,
2256
+ _host_index=_host_index,
2257
+ )
2258
+ )
2259
+
2260
+
2261
+ @validate_call
2262
+ def preview_clean_slate_api_import_clean_slate_preview_get_sync_without_preload_content(
2263
+ self,
2264
+ source_path: Annotated[str, Field(min_length=1, strict=True, description="The entry's raw (pre-import) source folder, under beetkeeper's `downloads_path`; for a standalone track, the audio file itself or a folder holding just that file.")],
2265
+ beets_album_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an album. Mutually exclusive with `beets_item_id`.")] = None,
2266
+ beets_item_id: Annotated[Optional[StrictInt], Field(description="The beets library id of an item (track). Mutually exclusive with `beets_album_id`.")] = None,
2267
+ allow_fewer_files: Annotated[Optional[StrictBool], Field(description="Proceed even when the source holds fewer audio files than the entry currently has on disk (the clean slate would then delete files the source cannot replace). Off by default.")] = None,
2268
+ _request_timeout: Union[
2269
+ None,
2270
+ Annotated[StrictFloat, Field(gt=0)],
2271
+ Tuple[
2272
+ Annotated[StrictFloat, Field(gt=0)],
2273
+ Annotated[StrictFloat, Field(gt=0)]
2274
+ ]
2275
+ ] = None,
2276
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2277
+ _content_type: Optional[StrictStr] = None,
2278
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2279
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2280
+ ) -> RESTResponseType:
2281
+ """Preview Clean Slate (synchronous)
2282
+
2283
+ Synchronous variant of :meth:`preview_clean_slate_api_import_clean_slate_preview_get_without_preload_content`. It calls
2284
+ the asynchronous method and blocks until it completes.
2285
+ """ # noqa: E501
2286
+ return run_sync(
2287
+ self.preview_clean_slate_api_import_clean_slate_preview_get_without_preload_content(
2288
+ source_path=source_path,
2289
+ beets_album_id=beets_album_id,
2290
+ beets_item_id=beets_item_id,
2291
+ allow_fewer_files=allow_fewer_files,
2292
+ _request_timeout=_request_timeout,
2293
+ _request_auth=_request_auth,
2294
+ _content_type=_content_type,
2295
+ _headers=_headers,
2296
+ _host_index=_host_index,
2297
+ )
2298
+ )
2299
+
2300
+
2301
+ def _preview_clean_slate_api_import_clean_slate_preview_get_serialize(
2302
+ self,
2303
+ source_path,
2304
+ beets_album_id,
2305
+ beets_item_id,
2306
+ allow_fewer_files,
2307
+ _request_auth,
2308
+ _content_type,
2309
+ _headers,
2310
+ _host_index,
2311
+ ) -> RequestSerialized:
2312
+
2313
+ _host = None
2314
+
2315
+ _collection_formats: Dict[str, str] = {
2316
+ }
2317
+
2318
+ _path_params: Dict[str, str] = {}
2319
+ _query_params: List[Tuple[str, str]] = []
2320
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2321
+ _form_params: List[Tuple[str, str]] = []
2322
+ _files: Dict[
2323
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2324
+ ] = {}
2325
+ _body_params: Optional[bytes] = None
2326
+
2327
+ # process the path parameters
2328
+ # process the query parameters
2329
+ if beets_album_id is not None:
2330
+
2331
+ _query_params.append(('beets_album_id', beets_album_id))
2332
+
2333
+ if beets_item_id is not None:
2334
+
2335
+ _query_params.append(('beets_item_id', beets_item_id))
2336
+
2337
+ if source_path is not None:
2338
+
2339
+ _query_params.append(('source_path', source_path))
2340
+
2341
+ if allow_fewer_files is not None:
2342
+
2343
+ _query_params.append(('allow_fewer_files', allow_fewer_files))
2344
+
2345
+ # process the header parameters
2346
+ # process the form parameters
2347
+ # process the body parameter
2348
+
2349
+
2350
+ # set the HTTP header `Accept`
2351
+ if 'Accept' not in _header_params:
2352
+ _header_params['Accept'] = self.api_client.select_header_accept(
2353
+ [
2354
+ 'application/json'
2355
+ ]
2356
+ )
2357
+
2358
+
2359
+ # authentication setting
2360
+ _auth_settings: List[str] = [
2361
+ ]
2362
+
2363
+ return self.api_client.param_serialize(
2364
+ method='GET',
2365
+ resource_path='/api/import/clean_slate/preview',
2366
+ path_params=_path_params,
2367
+ query_params=_query_params,
2368
+ header_params=_header_params,
2369
+ body=_body_params,
2370
+ post_params=_form_params,
2371
+ files=_files,
2372
+ auth_settings=_auth_settings,
2373
+ collection_formats=_collection_formats,
2374
+ _host=_host,
2375
+ _request_auth=_request_auth
2376
+ )
2377
+
2378
+
2379
+
2380
+
2381
+ @validate_call
2382
+ async def start_clean_slate_api_import_clean_slate_post(
2383
+ self,
2384
+ clean_slate_submit_request: CleanSlateSubmitRequest,
2385
+ _request_timeout: Union[
2386
+ None,
2387
+ Annotated[StrictFloat, Field(gt=0)],
2388
+ Tuple[
2389
+ Annotated[StrictFloat, Field(gt=0)],
2390
+ Annotated[StrictFloat, Field(gt=0)]
2391
+ ]
2392
+ ] = None,
2393
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2394
+ _content_type: Optional[StrictStr] = None,
2395
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2396
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2397
+ ) -> ImportJob:
2398
+ """Start Clean Slate
2399
+
2400
+ Enqueue a clean-slate import: remove the named library entry, then import its source folder afresh. The preview runs first: a blocking error is a 422, a source with fewer audio files than the entry has on disk is a 409 until `allow_fewer_files` is set, and an unknown beets id is a 404. The job is then tracked like any other import (poll it, answer its decisions, abort it via the routes below); the worker re-runs the preview as its guard right before removing anything.
2401
+
2402
+ :param clean_slate_submit_request: (required)
2403
+ :type clean_slate_submit_request: CleanSlateSubmitRequest
2404
+ :param _request_timeout: timeout setting for this request. If one
2405
+ number provided, it will be total request
2406
+ timeout. It can also be a pair (tuple) of
2407
+ (connection, read) timeouts.
2408
+ :type _request_timeout: int, tuple(int, int), optional
2409
+ :param _request_auth: set to override the auth_settings for an a single
2410
+ request; this effectively ignores the
2411
+ authentication in the spec for a single request.
2412
+ :type _request_auth: dict, optional
2413
+ :param _content_type: force content-type for the request.
2414
+ :type _content_type: str, Optional
2415
+ :param _headers: set to override the headers for a single
2416
+ request; this effectively ignores the headers
2417
+ in the spec for a single request.
2418
+ :type _headers: dict, optional
2419
+ :param _host_index: set to override the host_index for a single
2420
+ request; this effectively ignores the host_index
2421
+ in the spec for a single request.
2422
+ :type _host_index: int, optional
2423
+ :return: Returns the result object.
2424
+ """ # noqa: E501
2425
+
2426
+ _param = self._start_clean_slate_api_import_clean_slate_post_serialize(
2427
+ clean_slate_submit_request=clean_slate_submit_request,
2428
+ _request_auth=_request_auth,
2429
+ _content_type=_content_type,
2430
+ _headers=_headers,
2431
+ _host_index=_host_index
2432
+ )
2433
+
2434
+ _response_types_map: Dict[str, Optional[str]] = {
2435
+ '201': "ImportJob",
2436
+ '422': "HTTPValidationError",
2437
+ }
2438
+ response_data = await self.api_client.call_api(
2439
+ *_param,
2440
+ _request_timeout=_request_timeout
2441
+ )
2442
+ await response_data.read()
2443
+ return self.api_client.response_deserialize(
2444
+ response_data=response_data,
2445
+ response_types_map=_response_types_map,
2446
+ ).data
2447
+
2448
+
2449
+ @validate_call
2450
+ async def start_clean_slate_api_import_clean_slate_post_with_http_info(
2451
+ self,
2452
+ clean_slate_submit_request: CleanSlateSubmitRequest,
2453
+ _request_timeout: Union[
2454
+ None,
2455
+ Annotated[StrictFloat, Field(gt=0)],
2456
+ Tuple[
2457
+ Annotated[StrictFloat, Field(gt=0)],
2458
+ Annotated[StrictFloat, Field(gt=0)]
2459
+ ]
2460
+ ] = None,
2461
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2462
+ _content_type: Optional[StrictStr] = None,
2463
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2464
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2465
+ ) -> ApiResponse[ImportJob]:
2466
+ """Start Clean Slate
2467
+
2468
+ Enqueue a clean-slate import: remove the named library entry, then import its source folder afresh. The preview runs first: a blocking error is a 422, a source with fewer audio files than the entry has on disk is a 409 until `allow_fewer_files` is set, and an unknown beets id is a 404. The job is then tracked like any other import (poll it, answer its decisions, abort it via the routes below); the worker re-runs the preview as its guard right before removing anything.
2469
+
2470
+ :param clean_slate_submit_request: (required)
2471
+ :type clean_slate_submit_request: CleanSlateSubmitRequest
2472
+ :param _request_timeout: timeout setting for this request. If one
2473
+ number provided, it will be total request
2474
+ timeout. It can also be a pair (tuple) of
2475
+ (connection, read) timeouts.
2476
+ :type _request_timeout: int, tuple(int, int), optional
2477
+ :param _request_auth: set to override the auth_settings for an a single
2478
+ request; this effectively ignores the
2479
+ authentication in the spec for a single request.
2480
+ :type _request_auth: dict, optional
2481
+ :param _content_type: force content-type for the request.
2482
+ :type _content_type: str, Optional
2483
+ :param _headers: set to override the headers for a single
2484
+ request; this effectively ignores the headers
2485
+ in the spec for a single request.
2486
+ :type _headers: dict, optional
2487
+ :param _host_index: set to override the host_index for a single
2488
+ request; this effectively ignores the host_index
2489
+ in the spec for a single request.
2490
+ :type _host_index: int, optional
2491
+ :return: Returns the result object.
2492
+ """ # noqa: E501
2493
+
2494
+ _param = self._start_clean_slate_api_import_clean_slate_post_serialize(
2495
+ clean_slate_submit_request=clean_slate_submit_request,
2496
+ _request_auth=_request_auth,
2497
+ _content_type=_content_type,
2498
+ _headers=_headers,
2499
+ _host_index=_host_index
2500
+ )
2501
+
2502
+ _response_types_map: Dict[str, Optional[str]] = {
2503
+ '201': "ImportJob",
2504
+ '422': "HTTPValidationError",
2505
+ }
2506
+ response_data = await self.api_client.call_api(
2507
+ *_param,
2508
+ _request_timeout=_request_timeout
2509
+ )
2510
+ await response_data.read()
2511
+ return self.api_client.response_deserialize(
2512
+ response_data=response_data,
2513
+ response_types_map=_response_types_map,
2514
+ )
2515
+
2516
+
2517
+ @validate_call
2518
+ async def start_clean_slate_api_import_clean_slate_post_without_preload_content(
2519
+ self,
2520
+ clean_slate_submit_request: CleanSlateSubmitRequest,
2521
+ _request_timeout: Union[
2522
+ None,
2523
+ Annotated[StrictFloat, Field(gt=0)],
2524
+ Tuple[
2525
+ Annotated[StrictFloat, Field(gt=0)],
2526
+ Annotated[StrictFloat, Field(gt=0)]
2527
+ ]
2528
+ ] = None,
2529
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2530
+ _content_type: Optional[StrictStr] = None,
2531
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2532
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2533
+ ) -> RESTResponseType:
2534
+ """Start Clean Slate
2535
+
2536
+ Enqueue a clean-slate import: remove the named library entry, then import its source folder afresh. The preview runs first: a blocking error is a 422, a source with fewer audio files than the entry has on disk is a 409 until `allow_fewer_files` is set, and an unknown beets id is a 404. The job is then tracked like any other import (poll it, answer its decisions, abort it via the routes below); the worker re-runs the preview as its guard right before removing anything.
2537
+
2538
+ :param clean_slate_submit_request: (required)
2539
+ :type clean_slate_submit_request: CleanSlateSubmitRequest
2540
+ :param _request_timeout: timeout setting for this request. If one
2541
+ number provided, it will be total request
2542
+ timeout. It can also be a pair (tuple) of
2543
+ (connection, read) timeouts.
2544
+ :type _request_timeout: int, tuple(int, int), optional
2545
+ :param _request_auth: set to override the auth_settings for an a single
2546
+ request; this effectively ignores the
2547
+ authentication in the spec for a single request.
2548
+ :type _request_auth: dict, optional
2549
+ :param _content_type: force content-type for the request.
2550
+ :type _content_type: str, Optional
2551
+ :param _headers: set to override the headers for a single
2552
+ request; this effectively ignores the headers
2553
+ in the spec for a single request.
2554
+ :type _headers: dict, optional
2555
+ :param _host_index: set to override the host_index for a single
2556
+ request; this effectively ignores the host_index
2557
+ in the spec for a single request.
2558
+ :type _host_index: int, optional
2559
+ :return: Returns the result object.
2560
+ """ # noqa: E501
2561
+
2562
+ _param = self._start_clean_slate_api_import_clean_slate_post_serialize(
2563
+ clean_slate_submit_request=clean_slate_submit_request,
2564
+ _request_auth=_request_auth,
2565
+ _content_type=_content_type,
2566
+ _headers=_headers,
2567
+ _host_index=_host_index
2568
+ )
2569
+
2570
+ _response_types_map: Dict[str, Optional[str]] = {
2571
+ '201': "ImportJob",
2572
+ '422': "HTTPValidationError",
2573
+ }
2574
+ response_data = await self.api_client.call_api(
2575
+ *_param,
2576
+ _request_timeout=_request_timeout
2577
+ )
2578
+ return response_data.response
2579
+
2580
+
2581
+ @validate_call
2582
+ def start_clean_slate_api_import_clean_slate_post_sync(
2583
+ self,
2584
+ clean_slate_submit_request: CleanSlateSubmitRequest,
2585
+ _request_timeout: Union[
2586
+ None,
2587
+ Annotated[StrictFloat, Field(gt=0)],
2588
+ Tuple[
2589
+ Annotated[StrictFloat, Field(gt=0)],
2590
+ Annotated[StrictFloat, Field(gt=0)]
2591
+ ]
2592
+ ] = None,
2593
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2594
+ _content_type: Optional[StrictStr] = None,
2595
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2596
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2597
+ ) -> ImportJob:
2598
+ """Start Clean Slate (synchronous)
2599
+
2600
+ Synchronous variant of :meth:`start_clean_slate_api_import_clean_slate_post`. It calls the asynchronous
2601
+ method and blocks until it completes.
2602
+ """ # noqa: E501
2603
+ return run_sync(
2604
+ self.start_clean_slate_api_import_clean_slate_post(
2605
+ clean_slate_submit_request=clean_slate_submit_request,
2606
+ _request_timeout=_request_timeout,
2607
+ _request_auth=_request_auth,
2608
+ _content_type=_content_type,
2609
+ _headers=_headers,
2610
+ _host_index=_host_index,
2611
+ )
2612
+ )
2613
+
2614
+
2615
+ @validate_call
2616
+ def start_clean_slate_api_import_clean_slate_post_sync_with_http_info(
2617
+ self,
2618
+ clean_slate_submit_request: CleanSlateSubmitRequest,
2619
+ _request_timeout: Union[
2620
+ None,
2621
+ Annotated[StrictFloat, Field(gt=0)],
2622
+ Tuple[
2623
+ Annotated[StrictFloat, Field(gt=0)],
2624
+ Annotated[StrictFloat, Field(gt=0)]
2625
+ ]
2626
+ ] = None,
2627
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2628
+ _content_type: Optional[StrictStr] = None,
2629
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2630
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2631
+ ) -> ApiResponse[ImportJob]:
2632
+ """Start Clean Slate (synchronous)
2633
+
2634
+ Synchronous variant of :meth:`start_clean_slate_api_import_clean_slate_post_with_http_info`. It calls the
2635
+ asynchronous method and blocks until it completes.
2636
+ """ # noqa: E501
2637
+ return run_sync(
2638
+ self.start_clean_slate_api_import_clean_slate_post_with_http_info(
2639
+ clean_slate_submit_request=clean_slate_submit_request,
2640
+ _request_timeout=_request_timeout,
2641
+ _request_auth=_request_auth,
2642
+ _content_type=_content_type,
2643
+ _headers=_headers,
2644
+ _host_index=_host_index,
2645
+ )
2646
+ )
2647
+
2648
+
2649
+ @validate_call
2650
+ def start_clean_slate_api_import_clean_slate_post_sync_without_preload_content(
2651
+ self,
2652
+ clean_slate_submit_request: CleanSlateSubmitRequest,
2653
+ _request_timeout: Union[
2654
+ None,
2655
+ Annotated[StrictFloat, Field(gt=0)],
2656
+ Tuple[
2657
+ Annotated[StrictFloat, Field(gt=0)],
2658
+ Annotated[StrictFloat, Field(gt=0)]
2659
+ ]
2660
+ ] = None,
2661
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2662
+ _content_type: Optional[StrictStr] = None,
2663
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2664
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2665
+ ) -> RESTResponseType:
2666
+ """Start Clean Slate (synchronous)
2667
+
2668
+ Synchronous variant of :meth:`start_clean_slate_api_import_clean_slate_post_without_preload_content`. It calls
2669
+ the asynchronous method and blocks until it completes.
2670
+ """ # noqa: E501
2671
+ return run_sync(
2672
+ self.start_clean_slate_api_import_clean_slate_post_without_preload_content(
2673
+ clean_slate_submit_request=clean_slate_submit_request,
2674
+ _request_timeout=_request_timeout,
2675
+ _request_auth=_request_auth,
2676
+ _content_type=_content_type,
2677
+ _headers=_headers,
2678
+ _host_index=_host_index,
2679
+ )
2680
+ )
2681
+
2682
+
2683
+ def _start_clean_slate_api_import_clean_slate_post_serialize(
2684
+ self,
2685
+ clean_slate_submit_request,
2686
+ _request_auth,
2687
+ _content_type,
2688
+ _headers,
2689
+ _host_index,
2690
+ ) -> RequestSerialized:
2691
+
2692
+ _host = None
2693
+
2694
+ _collection_formats: Dict[str, str] = {
2695
+ }
2696
+
2697
+ _path_params: Dict[str, str] = {}
2698
+ _query_params: List[Tuple[str, str]] = []
2699
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2700
+ _form_params: List[Tuple[str, str]] = []
2701
+ _files: Dict[
2702
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2703
+ ] = {}
2704
+ _body_params: Optional[bytes] = None
2705
+
2706
+ # process the path parameters
2707
+ # process the query parameters
2708
+ # process the header parameters
2709
+ # process the form parameters
2710
+ # process the body parameter
2711
+ if clean_slate_submit_request is not None:
2712
+ _body_params = clean_slate_submit_request
2713
+
2714
+
2715
+ # set the HTTP header `Accept`
2716
+ if 'Accept' not in _header_params:
2717
+ _header_params['Accept'] = self.api_client.select_header_accept(
2718
+ [
2719
+ 'application/json'
2720
+ ]
2721
+ )
2722
+
2723
+ # set the HTTP header `Content-Type`
2724
+ if _content_type:
2725
+ _header_params['Content-Type'] = _content_type
2726
+ else:
2727
+ _default_content_type = (
2728
+ self.api_client.select_header_content_type(
2729
+ [
2730
+ 'application/json'
2731
+ ]
2732
+ )
2733
+ )
2734
+ if _default_content_type is not None:
2735
+ _header_params['Content-Type'] = _default_content_type
2736
+
2737
+ # authentication setting
2738
+ _auth_settings: List[str] = [
2739
+ ]
2740
+
2741
+ return self.api_client.param_serialize(
2742
+ method='POST',
2743
+ resource_path='/api/import/clean_slate',
2744
+ path_params=_path_params,
2745
+ query_params=_query_params,
2746
+ header_params=_header_params,
2747
+ body=_body_params,
2748
+ post_params=_form_params,
2749
+ files=_files,
2750
+ auth_settings=_auth_settings,
2751
+ collection_formats=_collection_formats,
2752
+ _host=_host,
2753
+ _request_auth=_request_auth
2754
+ )
2755
+
2756
+
2757
+
2758
+
2759
+ @validate_call
2760
+ async def start_import_api_import_post(
2761
+ self,
2762
+ import_submit_request: ImportSubmitRequest,
2763
+ _request_timeout: Union[
2764
+ None,
2765
+ Annotated[StrictFloat, Field(gt=0)],
2766
+ Tuple[
2767
+ Annotated[StrictFloat, Field(gt=0)],
2768
+ Annotated[StrictFloat, Field(gt=0)]
2769
+ ]
2770
+ ] = None,
2771
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2772
+ _content_type: Optional[StrictStr] = None,
2773
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2774
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2775
+ ) -> ImportJob:
2776
+ """Start Import
2777
+
2778
+ Enqueue an import of the given paths and return the created (PENDING) job. Set `quiet=true` to import non-interactively (the `beet import -q` equivalent): no decision prompts. The optional per-job settings (`quiet`, `logpath`, `group_albums`, `flat`, `set_fields`) default to the corresponding beets config values when left unspecified.
2779
+
2780
+ :param import_submit_request: (required)
2781
+ :type import_submit_request: ImportSubmitRequest
2782
+ :param _request_timeout: timeout setting for this request. If one
2783
+ number provided, it will be total request
2784
+ timeout. It can also be a pair (tuple) of
2785
+ (connection, read) timeouts.
2786
+ :type _request_timeout: int, tuple(int, int), optional
2787
+ :param _request_auth: set to override the auth_settings for an a single
2788
+ request; this effectively ignores the
2789
+ authentication in the spec for a single request.
2790
+ :type _request_auth: dict, optional
2791
+ :param _content_type: force content-type for the request.
2792
+ :type _content_type: str, Optional
2793
+ :param _headers: set to override the headers for a single
2794
+ request; this effectively ignores the headers
2795
+ in the spec for a single request.
2796
+ :type _headers: dict, optional
2797
+ :param _host_index: set to override the host_index for a single
2798
+ request; this effectively ignores the host_index
2799
+ in the spec for a single request.
2800
+ :type _host_index: int, optional
2801
+ :return: Returns the result object.
2802
+ """ # noqa: E501
2803
+
2804
+ _param = self._start_import_api_import_post_serialize(
2805
+ import_submit_request=import_submit_request,
2806
+ _request_auth=_request_auth,
2807
+ _content_type=_content_type,
2808
+ _headers=_headers,
2809
+ _host_index=_host_index
2810
+ )
2811
+
2812
+ _response_types_map: Dict[str, Optional[str]] = {
2813
+ '201': "ImportJob",
2814
+ '422': "HTTPValidationError",
2815
+ }
2816
+ response_data = await self.api_client.call_api(
2817
+ *_param,
2818
+ _request_timeout=_request_timeout
2819
+ )
2820
+ await response_data.read()
2821
+ return self.api_client.response_deserialize(
2822
+ response_data=response_data,
2823
+ response_types_map=_response_types_map,
2824
+ ).data
2825
+
2826
+
2827
+ @validate_call
2828
+ async def start_import_api_import_post_with_http_info(
2829
+ self,
2830
+ import_submit_request: ImportSubmitRequest,
2831
+ _request_timeout: Union[
2832
+ None,
2833
+ Annotated[StrictFloat, Field(gt=0)],
2834
+ Tuple[
2835
+ Annotated[StrictFloat, Field(gt=0)],
2836
+ Annotated[StrictFloat, Field(gt=0)]
2837
+ ]
2838
+ ] = None,
2839
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2840
+ _content_type: Optional[StrictStr] = None,
2841
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2842
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2843
+ ) -> ApiResponse[ImportJob]:
2844
+ """Start Import
2845
+
2846
+ Enqueue an import of the given paths and return the created (PENDING) job. Set `quiet=true` to import non-interactively (the `beet import -q` equivalent): no decision prompts. The optional per-job settings (`quiet`, `logpath`, `group_albums`, `flat`, `set_fields`) default to the corresponding beets config values when left unspecified.
2847
+
2848
+ :param import_submit_request: (required)
2849
+ :type import_submit_request: ImportSubmitRequest
2850
+ :param _request_timeout: timeout setting for this request. If one
2851
+ number provided, it will be total request
2852
+ timeout. It can also be a pair (tuple) of
2853
+ (connection, read) timeouts.
2854
+ :type _request_timeout: int, tuple(int, int), optional
2855
+ :param _request_auth: set to override the auth_settings for an a single
2856
+ request; this effectively ignores the
2857
+ authentication in the spec for a single request.
2858
+ :type _request_auth: dict, optional
2859
+ :param _content_type: force content-type for the request.
2860
+ :type _content_type: str, Optional
2861
+ :param _headers: set to override the headers for a single
2862
+ request; this effectively ignores the headers
2863
+ in the spec for a single request.
2864
+ :type _headers: dict, optional
2865
+ :param _host_index: set to override the host_index for a single
2866
+ request; this effectively ignores the host_index
2867
+ in the spec for a single request.
2868
+ :type _host_index: int, optional
2869
+ :return: Returns the result object.
2870
+ """ # noqa: E501
2871
+
2872
+ _param = self._start_import_api_import_post_serialize(
2873
+ import_submit_request=import_submit_request,
2874
+ _request_auth=_request_auth,
2875
+ _content_type=_content_type,
2876
+ _headers=_headers,
2877
+ _host_index=_host_index
2878
+ )
2879
+
2880
+ _response_types_map: Dict[str, Optional[str]] = {
2881
+ '201': "ImportJob",
2882
+ '422': "HTTPValidationError",
2883
+ }
2884
+ response_data = await self.api_client.call_api(
2885
+ *_param,
2886
+ _request_timeout=_request_timeout
2887
+ )
2888
+ await response_data.read()
2889
+ return self.api_client.response_deserialize(
2890
+ response_data=response_data,
2891
+ response_types_map=_response_types_map,
2892
+ )
2893
+
2894
+
2895
+ @validate_call
2896
+ async def start_import_api_import_post_without_preload_content(
2897
+ self,
2898
+ import_submit_request: ImportSubmitRequest,
2899
+ _request_timeout: Union[
2900
+ None,
2901
+ Annotated[StrictFloat, Field(gt=0)],
2902
+ Tuple[
2903
+ Annotated[StrictFloat, Field(gt=0)],
2904
+ Annotated[StrictFloat, Field(gt=0)]
2905
+ ]
2906
+ ] = None,
2907
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2908
+ _content_type: Optional[StrictStr] = None,
2909
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2910
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2911
+ ) -> RESTResponseType:
2912
+ """Start Import
2913
+
2914
+ Enqueue an import of the given paths and return the created (PENDING) job. Set `quiet=true` to import non-interactively (the `beet import -q` equivalent): no decision prompts. The optional per-job settings (`quiet`, `logpath`, `group_albums`, `flat`, `set_fields`) default to the corresponding beets config values when left unspecified.
2915
+
2916
+ :param import_submit_request: (required)
2917
+ :type import_submit_request: ImportSubmitRequest
2918
+ :param _request_timeout: timeout setting for this request. If one
2919
+ number provided, it will be total request
2920
+ timeout. It can also be a pair (tuple) of
2921
+ (connection, read) timeouts.
2922
+ :type _request_timeout: int, tuple(int, int), optional
2923
+ :param _request_auth: set to override the auth_settings for an a single
2924
+ request; this effectively ignores the
2925
+ authentication in the spec for a single request.
2926
+ :type _request_auth: dict, optional
2927
+ :param _content_type: force content-type for the request.
2928
+ :type _content_type: str, Optional
2929
+ :param _headers: set to override the headers for a single
2930
+ request; this effectively ignores the headers
2931
+ in the spec for a single request.
2932
+ :type _headers: dict, optional
2933
+ :param _host_index: set to override the host_index for a single
2934
+ request; this effectively ignores the host_index
2935
+ in the spec for a single request.
2936
+ :type _host_index: int, optional
2937
+ :return: Returns the result object.
2938
+ """ # noqa: E501
2939
+
2940
+ _param = self._start_import_api_import_post_serialize(
2941
+ import_submit_request=import_submit_request,
2942
+ _request_auth=_request_auth,
2943
+ _content_type=_content_type,
2944
+ _headers=_headers,
2945
+ _host_index=_host_index
2946
+ )
2947
+
2948
+ _response_types_map: Dict[str, Optional[str]] = {
2949
+ '201': "ImportJob",
2950
+ '422': "HTTPValidationError",
2951
+ }
2952
+ response_data = await self.api_client.call_api(
2953
+ *_param,
2954
+ _request_timeout=_request_timeout
2955
+ )
2956
+ return response_data.response
2957
+
2958
+
2959
+ @validate_call
2960
+ def start_import_api_import_post_sync(
2961
+ self,
2962
+ import_submit_request: ImportSubmitRequest,
2963
+ _request_timeout: Union[
2964
+ None,
2965
+ Annotated[StrictFloat, Field(gt=0)],
2966
+ Tuple[
2967
+ Annotated[StrictFloat, Field(gt=0)],
2968
+ Annotated[StrictFloat, Field(gt=0)]
2969
+ ]
2970
+ ] = None,
2971
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2972
+ _content_type: Optional[StrictStr] = None,
2973
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2974
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2975
+ ) -> ImportJob:
2976
+ """Start Import (synchronous)
2977
+
2978
+ Synchronous variant of :meth:`start_import_api_import_post`. It calls the asynchronous
2979
+ method and blocks until it completes.
2980
+ """ # noqa: E501
2981
+ return run_sync(
2982
+ self.start_import_api_import_post(
2983
+ import_submit_request=import_submit_request,
2984
+ _request_timeout=_request_timeout,
2985
+ _request_auth=_request_auth,
2986
+ _content_type=_content_type,
2987
+ _headers=_headers,
2988
+ _host_index=_host_index,
2989
+ )
2990
+ )
2991
+
2992
+
2993
+ @validate_call
2994
+ def start_import_api_import_post_sync_with_http_info(
2995
+ self,
2996
+ import_submit_request: ImportSubmitRequest,
2997
+ _request_timeout: Union[
2998
+ None,
2999
+ Annotated[StrictFloat, Field(gt=0)],
3000
+ Tuple[
3001
+ Annotated[StrictFloat, Field(gt=0)],
3002
+ Annotated[StrictFloat, Field(gt=0)]
3003
+ ]
3004
+ ] = None,
3005
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3006
+ _content_type: Optional[StrictStr] = None,
3007
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3008
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3009
+ ) -> ApiResponse[ImportJob]:
3010
+ """Start Import (synchronous)
3011
+
3012
+ Synchronous variant of :meth:`start_import_api_import_post_with_http_info`. It calls the
3013
+ asynchronous method and blocks until it completes.
3014
+ """ # noqa: E501
3015
+ return run_sync(
3016
+ self.start_import_api_import_post_with_http_info(
3017
+ import_submit_request=import_submit_request,
3018
+ _request_timeout=_request_timeout,
3019
+ _request_auth=_request_auth,
3020
+ _content_type=_content_type,
3021
+ _headers=_headers,
3022
+ _host_index=_host_index,
3023
+ )
3024
+ )
3025
+
3026
+
3027
+ @validate_call
3028
+ def start_import_api_import_post_sync_without_preload_content(
3029
+ self,
3030
+ import_submit_request: ImportSubmitRequest,
3031
+ _request_timeout: Union[
3032
+ None,
3033
+ Annotated[StrictFloat, Field(gt=0)],
3034
+ Tuple[
3035
+ Annotated[StrictFloat, Field(gt=0)],
3036
+ Annotated[StrictFloat, Field(gt=0)]
3037
+ ]
3038
+ ] = None,
3039
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3040
+ _content_type: Optional[StrictStr] = None,
3041
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3042
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3043
+ ) -> RESTResponseType:
3044
+ """Start Import (synchronous)
3045
+
3046
+ Synchronous variant of :meth:`start_import_api_import_post_without_preload_content`. It calls
3047
+ the asynchronous method and blocks until it completes.
3048
+ """ # noqa: E501
3049
+ return run_sync(
3050
+ self.start_import_api_import_post_without_preload_content(
3051
+ import_submit_request=import_submit_request,
3052
+ _request_timeout=_request_timeout,
3053
+ _request_auth=_request_auth,
3054
+ _content_type=_content_type,
3055
+ _headers=_headers,
3056
+ _host_index=_host_index,
3057
+ )
3058
+ )
3059
+
3060
+
3061
+ def _start_import_api_import_post_serialize(
3062
+ self,
3063
+ import_submit_request,
3064
+ _request_auth,
3065
+ _content_type,
3066
+ _headers,
3067
+ _host_index,
3068
+ ) -> RequestSerialized:
3069
+
3070
+ _host = None
3071
+
3072
+ _collection_formats: Dict[str, str] = {
3073
+ }
3074
+
3075
+ _path_params: Dict[str, str] = {}
3076
+ _query_params: List[Tuple[str, str]] = []
3077
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3078
+ _form_params: List[Tuple[str, str]] = []
3079
+ _files: Dict[
3080
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3081
+ ] = {}
3082
+ _body_params: Optional[bytes] = None
3083
+
3084
+ # process the path parameters
3085
+ # process the query parameters
3086
+ # process the header parameters
3087
+ # process the form parameters
3088
+ # process the body parameter
3089
+ if import_submit_request is not None:
3090
+ _body_params = import_submit_request
3091
+
3092
+
3093
+ # set the HTTP header `Accept`
3094
+ if 'Accept' not in _header_params:
3095
+ _header_params['Accept'] = self.api_client.select_header_accept(
3096
+ [
3097
+ 'application/json'
3098
+ ]
3099
+ )
3100
+
3101
+ # set the HTTP header `Content-Type`
3102
+ if _content_type:
3103
+ _header_params['Content-Type'] = _content_type
3104
+ else:
3105
+ _default_content_type = (
3106
+ self.api_client.select_header_content_type(
3107
+ [
3108
+ 'application/json'
3109
+ ]
3110
+ )
3111
+ )
3112
+ if _default_content_type is not None:
3113
+ _header_params['Content-Type'] = _default_content_type
3114
+
3115
+ # authentication setting
3116
+ _auth_settings: List[str] = [
3117
+ ]
3118
+
3119
+ return self.api_client.param_serialize(
3120
+ method='POST',
3121
+ resource_path='/api/import',
3122
+ path_params=_path_params,
3123
+ query_params=_query_params,
3124
+ header_params=_header_params,
3125
+ body=_body_params,
3126
+ post_params=_form_params,
3127
+ files=_files,
3128
+ auth_settings=_auth_settings,
3129
+ collection_formats=_collection_formats,
3130
+ _host=_host,
3131
+ _request_auth=_request_auth
3132
+ )
3133
+
3134
+