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,1250 @@
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, StrictStr
19
+ from typing import Any, Dict, List, Optional
20
+ from typing_extensions import Annotated
21
+
22
+ from beetkeeper_api_client.api_client import ApiClient, RequestSerialized
23
+ from beetkeeper_api_client.api_response import ApiResponse
24
+ from beetkeeper_api_client.rest import RESTResponseType
25
+ from beetkeeper_api_client.sync_helper import run_sync
26
+
27
+
28
+ class QueryApi:
29
+ """NOTE: This class is auto generated by OpenAPI Generator
30
+ Ref: https://openapi-generator.tech
31
+
32
+ Do not edit the class manually.
33
+ """
34
+
35
+ def __init__(self, api_client=None) -> None:
36
+ if api_client is None:
37
+ api_client = ApiClient.get_default()
38
+ self.api_client = api_client
39
+
40
+
41
+ @validate_call
42
+ async def fields_api_query_fields_get(
43
+ self,
44
+ _request_timeout: Union[
45
+ None,
46
+ Annotated[StrictFloat, Field(gt=0)],
47
+ Tuple[
48
+ Annotated[StrictFloat, Field(gt=0)],
49
+ Annotated[StrictFloat, Field(gt=0)]
50
+ ]
51
+ ] = None,
52
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
53
+ _content_type: Optional[StrictStr] = None,
54
+ _headers: Optional[Dict[StrictStr, Any]] = None,
55
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
56
+ ) -> Dict[str, List[str]]:
57
+ """Fields
58
+
59
+ Execute `beet fields`: the item/album query fields and flexible attributes available. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#fields
60
+
61
+ :param _request_timeout: timeout setting for this request. If one
62
+ number provided, it will be total request
63
+ timeout. It can also be a pair (tuple) of
64
+ (connection, read) timeouts.
65
+ :type _request_timeout: int, tuple(int, int), optional
66
+ :param _request_auth: set to override the auth_settings for an a single
67
+ request; this effectively ignores the
68
+ authentication in the spec for a single request.
69
+ :type _request_auth: dict, optional
70
+ :param _content_type: force content-type for the request.
71
+ :type _content_type: str, Optional
72
+ :param _headers: set to override the headers for a single
73
+ request; this effectively ignores the headers
74
+ in the spec for a single request.
75
+ :type _headers: dict, optional
76
+ :param _host_index: set to override the host_index for a single
77
+ request; this effectively ignores the host_index
78
+ in the spec for a single request.
79
+ :type _host_index: int, optional
80
+ :return: Returns the result object.
81
+ """ # noqa: E501
82
+
83
+ _param = self._fields_api_query_fields_get_serialize(
84
+ _request_auth=_request_auth,
85
+ _content_type=_content_type,
86
+ _headers=_headers,
87
+ _host_index=_host_index
88
+ )
89
+
90
+ _response_types_map: Dict[str, Optional[str]] = {
91
+ '200': "Dict[str, List[str]]",
92
+ }
93
+ response_data = await self.api_client.call_api(
94
+ *_param,
95
+ _request_timeout=_request_timeout
96
+ )
97
+ await response_data.read()
98
+ return self.api_client.response_deserialize(
99
+ response_data=response_data,
100
+ response_types_map=_response_types_map,
101
+ ).data
102
+
103
+
104
+ @validate_call
105
+ async def fields_api_query_fields_get_with_http_info(
106
+ self,
107
+ _request_timeout: Union[
108
+ None,
109
+ Annotated[StrictFloat, Field(gt=0)],
110
+ Tuple[
111
+ Annotated[StrictFloat, Field(gt=0)],
112
+ Annotated[StrictFloat, Field(gt=0)]
113
+ ]
114
+ ] = None,
115
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
116
+ _content_type: Optional[StrictStr] = None,
117
+ _headers: Optional[Dict[StrictStr, Any]] = None,
118
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
119
+ ) -> ApiResponse[Dict[str, List[str]]]:
120
+ """Fields
121
+
122
+ Execute `beet fields`: the item/album query fields and flexible attributes available. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#fields
123
+
124
+ :param _request_timeout: timeout setting for this request. If one
125
+ number provided, it will be total request
126
+ timeout. It can also be a pair (tuple) of
127
+ (connection, read) timeouts.
128
+ :type _request_timeout: int, tuple(int, int), optional
129
+ :param _request_auth: set to override the auth_settings for an a single
130
+ request; this effectively ignores the
131
+ authentication in the spec for a single request.
132
+ :type _request_auth: dict, optional
133
+ :param _content_type: force content-type for the request.
134
+ :type _content_type: str, Optional
135
+ :param _headers: set to override the headers for a single
136
+ request; this effectively ignores the headers
137
+ in the spec for a single request.
138
+ :type _headers: dict, optional
139
+ :param _host_index: set to override the host_index for a single
140
+ request; this effectively ignores the host_index
141
+ in the spec for a single request.
142
+ :type _host_index: int, optional
143
+ :return: Returns the result object.
144
+ """ # noqa: E501
145
+
146
+ _param = self._fields_api_query_fields_get_serialize(
147
+ _request_auth=_request_auth,
148
+ _content_type=_content_type,
149
+ _headers=_headers,
150
+ _host_index=_host_index
151
+ )
152
+
153
+ _response_types_map: Dict[str, Optional[str]] = {
154
+ '200': "Dict[str, List[str]]",
155
+ }
156
+ response_data = await self.api_client.call_api(
157
+ *_param,
158
+ _request_timeout=_request_timeout
159
+ )
160
+ await response_data.read()
161
+ return self.api_client.response_deserialize(
162
+ response_data=response_data,
163
+ response_types_map=_response_types_map,
164
+ )
165
+
166
+
167
+ @validate_call
168
+ async def fields_api_query_fields_get_without_preload_content(
169
+ self,
170
+ _request_timeout: Union[
171
+ None,
172
+ Annotated[StrictFloat, Field(gt=0)],
173
+ Tuple[
174
+ Annotated[StrictFloat, Field(gt=0)],
175
+ Annotated[StrictFloat, Field(gt=0)]
176
+ ]
177
+ ] = None,
178
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
179
+ _content_type: Optional[StrictStr] = None,
180
+ _headers: Optional[Dict[StrictStr, Any]] = None,
181
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
182
+ ) -> RESTResponseType:
183
+ """Fields
184
+
185
+ Execute `beet fields`: the item/album query fields and flexible attributes available. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#fields
186
+
187
+ :param _request_timeout: timeout setting for this request. If one
188
+ number provided, it will be total request
189
+ timeout. It can also be a pair (tuple) of
190
+ (connection, read) timeouts.
191
+ :type _request_timeout: int, tuple(int, int), optional
192
+ :param _request_auth: set to override the auth_settings for an a single
193
+ request; this effectively ignores the
194
+ authentication in the spec for a single request.
195
+ :type _request_auth: dict, optional
196
+ :param _content_type: force content-type for the request.
197
+ :type _content_type: str, Optional
198
+ :param _headers: set to override the headers for a single
199
+ request; this effectively ignores the headers
200
+ in the spec for a single request.
201
+ :type _headers: dict, optional
202
+ :param _host_index: set to override the host_index for a single
203
+ request; this effectively ignores the host_index
204
+ in the spec for a single request.
205
+ :type _host_index: int, optional
206
+ :return: Returns the result object.
207
+ """ # noqa: E501
208
+
209
+ _param = self._fields_api_query_fields_get_serialize(
210
+ _request_auth=_request_auth,
211
+ _content_type=_content_type,
212
+ _headers=_headers,
213
+ _host_index=_host_index
214
+ )
215
+
216
+ _response_types_map: Dict[str, Optional[str]] = {
217
+ '200': "Dict[str, List[str]]",
218
+ }
219
+ response_data = await self.api_client.call_api(
220
+ *_param,
221
+ _request_timeout=_request_timeout
222
+ )
223
+ return response_data.response
224
+
225
+
226
+ @validate_call
227
+ def fields_api_query_fields_get_sync(
228
+ self,
229
+ _request_timeout: Union[
230
+ None,
231
+ Annotated[StrictFloat, Field(gt=0)],
232
+ Tuple[
233
+ Annotated[StrictFloat, Field(gt=0)],
234
+ Annotated[StrictFloat, Field(gt=0)]
235
+ ]
236
+ ] = None,
237
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
238
+ _content_type: Optional[StrictStr] = None,
239
+ _headers: Optional[Dict[StrictStr, Any]] = None,
240
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
241
+ ) -> Dict[str, List[str]]:
242
+ """Fields (synchronous)
243
+
244
+ Synchronous variant of :meth:`fields_api_query_fields_get`. It calls the asynchronous
245
+ method and blocks until it completes.
246
+ """ # noqa: E501
247
+ return run_sync(
248
+ self.fields_api_query_fields_get(
249
+ _request_timeout=_request_timeout,
250
+ _request_auth=_request_auth,
251
+ _content_type=_content_type,
252
+ _headers=_headers,
253
+ _host_index=_host_index,
254
+ )
255
+ )
256
+
257
+
258
+ @validate_call
259
+ def fields_api_query_fields_get_sync_with_http_info(
260
+ self,
261
+ _request_timeout: Union[
262
+ None,
263
+ Annotated[StrictFloat, Field(gt=0)],
264
+ Tuple[
265
+ Annotated[StrictFloat, Field(gt=0)],
266
+ Annotated[StrictFloat, Field(gt=0)]
267
+ ]
268
+ ] = None,
269
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
270
+ _content_type: Optional[StrictStr] = None,
271
+ _headers: Optional[Dict[StrictStr, Any]] = None,
272
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
273
+ ) -> ApiResponse[Dict[str, List[str]]]:
274
+ """Fields (synchronous)
275
+
276
+ Synchronous variant of :meth:`fields_api_query_fields_get_with_http_info`. It calls the
277
+ asynchronous method and blocks until it completes.
278
+ """ # noqa: E501
279
+ return run_sync(
280
+ self.fields_api_query_fields_get_with_http_info(
281
+ _request_timeout=_request_timeout,
282
+ _request_auth=_request_auth,
283
+ _content_type=_content_type,
284
+ _headers=_headers,
285
+ _host_index=_host_index,
286
+ )
287
+ )
288
+
289
+
290
+ @validate_call
291
+ def fields_api_query_fields_get_sync_without_preload_content(
292
+ self,
293
+ _request_timeout: Union[
294
+ None,
295
+ Annotated[StrictFloat, Field(gt=0)],
296
+ Tuple[
297
+ Annotated[StrictFloat, Field(gt=0)],
298
+ Annotated[StrictFloat, Field(gt=0)]
299
+ ]
300
+ ] = None,
301
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
302
+ _content_type: Optional[StrictStr] = None,
303
+ _headers: Optional[Dict[StrictStr, Any]] = None,
304
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
305
+ ) -> RESTResponseType:
306
+ """Fields (synchronous)
307
+
308
+ Synchronous variant of :meth:`fields_api_query_fields_get_without_preload_content`. It calls
309
+ the asynchronous method and blocks until it completes.
310
+ """ # noqa: E501
311
+ return run_sync(
312
+ self.fields_api_query_fields_get_without_preload_content(
313
+ _request_timeout=_request_timeout,
314
+ _request_auth=_request_auth,
315
+ _content_type=_content_type,
316
+ _headers=_headers,
317
+ _host_index=_host_index,
318
+ )
319
+ )
320
+
321
+
322
+ def _fields_api_query_fields_get_serialize(
323
+ self,
324
+ _request_auth,
325
+ _content_type,
326
+ _headers,
327
+ _host_index,
328
+ ) -> RequestSerialized:
329
+
330
+ _host = None
331
+
332
+ _collection_formats: Dict[str, str] = {
333
+ }
334
+
335
+ _path_params: Dict[str, str] = {}
336
+ _query_params: List[Tuple[str, str]] = []
337
+ _header_params: Dict[str, Optional[str]] = _headers or {}
338
+ _form_params: List[Tuple[str, str]] = []
339
+ _files: Dict[
340
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
341
+ ] = {}
342
+ _body_params: Optional[bytes] = None
343
+
344
+ # process the path parameters
345
+ # process the query parameters
346
+ # process the header parameters
347
+ # process the form parameters
348
+ # process the body parameter
349
+
350
+
351
+ # set the HTTP header `Accept`
352
+ if 'Accept' not in _header_params:
353
+ _header_params['Accept'] = self.api_client.select_header_accept(
354
+ [
355
+ 'application/json'
356
+ ]
357
+ )
358
+
359
+
360
+ # authentication setting
361
+ _auth_settings: List[str] = [
362
+ ]
363
+
364
+ return self.api_client.param_serialize(
365
+ method='GET',
366
+ resource_path='/api/query/fields',
367
+ path_params=_path_params,
368
+ query_params=_query_params,
369
+ header_params=_header_params,
370
+ body=_body_params,
371
+ post_params=_form_params,
372
+ files=_files,
373
+ auth_settings=_auth_settings,
374
+ collection_formats=_collection_formats,
375
+ _host=_host,
376
+ _request_auth=_request_auth
377
+ )
378
+
379
+
380
+
381
+
382
+ @validate_call
383
+ async def list_api_query_list_get(
384
+ self,
385
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
386
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
387
+ albums: Annotated[Optional[StrictBool], Field(description="Like `-a`; return albums instead of individual tracks.")] = None,
388
+ keyword: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Repeatable bare-keyword query parts (substring match across default fields).")] = None,
389
+ var_field: Annotated[Optional[List[StrictStr]], Field(description="Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).")] = None,
390
+ phrase: Annotated[Optional[StrictStr], Field(description="A single multi-word phrase part.")] = None,
391
+ filepath: Annotated[Optional[StrictStr], Field(description="A path within the beets library (becomes a path query).")] = None,
392
+ sort_by: Annotated[Optional[StrictStr], Field(description="A beets sort token, e.g. `year+` or `artist-`.")] = None,
393
+ _request_timeout: Union[
394
+ None,
395
+ Annotated[StrictFloat, Field(gt=0)],
396
+ Tuple[
397
+ Annotated[StrictFloat, Field(gt=0)],
398
+ Annotated[StrictFloat, Field(gt=0)]
399
+ ]
400
+ ] = None,
401
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
402
+ _content_type: Optional[StrictStr] = None,
403
+ _headers: Optional[Dict[StrictStr, Any]] = None,
404
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
405
+ ) -> List[Dict[str, Optional[object]]]:
406
+ """List
407
+
408
+ Execute `beet list ...`: return one page of matching tracks (or albums) as JSON objects. The query params (pagination plus the beets query inputs, some repeatable) are documented on `ListQueryParams`. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#list
409
+
410
+ :param page: The page number, 1-indexed.
411
+ :type page: int
412
+ :param page_size: Maximum results per page.
413
+ :type page_size: int
414
+ :param albums: Like `-a`; return albums instead of individual tracks.
415
+ :type albums: bool
416
+ :param keyword: Repeatable bare-keyword query parts (substring match across default fields).
417
+ :type keyword: List[Optional[str]]
418
+ :param var_field: Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).
419
+ :type var_field: List[str]
420
+ :param phrase: A single multi-word phrase part.
421
+ :type phrase: str
422
+ :param filepath: A path within the beets library (becomes a path query).
423
+ :type filepath: str
424
+ :param sort_by: A beets sort token, e.g. `year+` or `artist-`.
425
+ :type sort_by: str
426
+ :param _request_timeout: timeout setting for this request. If one
427
+ number provided, it will be total request
428
+ timeout. It can also be a pair (tuple) of
429
+ (connection, read) timeouts.
430
+ :type _request_timeout: int, tuple(int, int), optional
431
+ :param _request_auth: set to override the auth_settings for an a single
432
+ request; this effectively ignores the
433
+ authentication in the spec for a single request.
434
+ :type _request_auth: dict, optional
435
+ :param _content_type: force content-type for the request.
436
+ :type _content_type: str, Optional
437
+ :param _headers: set to override the headers for a single
438
+ request; this effectively ignores the headers
439
+ in the spec for a single request.
440
+ :type _headers: dict, optional
441
+ :param _host_index: set to override the host_index for a single
442
+ request; this effectively ignores the host_index
443
+ in the spec for a single request.
444
+ :type _host_index: int, optional
445
+ :return: Returns the result object.
446
+ """ # noqa: E501
447
+
448
+ _param = self._list_api_query_list_get_serialize(
449
+ page=page,
450
+ page_size=page_size,
451
+ albums=albums,
452
+ keyword=keyword,
453
+ var_field=var_field,
454
+ phrase=phrase,
455
+ filepath=filepath,
456
+ sort_by=sort_by,
457
+ _request_auth=_request_auth,
458
+ _content_type=_content_type,
459
+ _headers=_headers,
460
+ _host_index=_host_index
461
+ )
462
+
463
+ _response_types_map: Dict[str, Optional[str]] = {
464
+ '200': "List[Dict[str, Optional[object]]]",
465
+ '422': "HTTPValidationError",
466
+ }
467
+ response_data = await self.api_client.call_api(
468
+ *_param,
469
+ _request_timeout=_request_timeout
470
+ )
471
+ await response_data.read()
472
+ return self.api_client.response_deserialize(
473
+ response_data=response_data,
474
+ response_types_map=_response_types_map,
475
+ ).data
476
+
477
+
478
+ @validate_call
479
+ async def list_api_query_list_get_with_http_info(
480
+ self,
481
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
482
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
483
+ albums: Annotated[Optional[StrictBool], Field(description="Like `-a`; return albums instead of individual tracks.")] = None,
484
+ keyword: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Repeatable bare-keyword query parts (substring match across default fields).")] = None,
485
+ var_field: Annotated[Optional[List[StrictStr]], Field(description="Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).")] = None,
486
+ phrase: Annotated[Optional[StrictStr], Field(description="A single multi-word phrase part.")] = None,
487
+ filepath: Annotated[Optional[StrictStr], Field(description="A path within the beets library (becomes a path query).")] = None,
488
+ sort_by: Annotated[Optional[StrictStr], Field(description="A beets sort token, e.g. `year+` or `artist-`.")] = None,
489
+ _request_timeout: Union[
490
+ None,
491
+ Annotated[StrictFloat, Field(gt=0)],
492
+ Tuple[
493
+ Annotated[StrictFloat, Field(gt=0)],
494
+ Annotated[StrictFloat, Field(gt=0)]
495
+ ]
496
+ ] = None,
497
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
498
+ _content_type: Optional[StrictStr] = None,
499
+ _headers: Optional[Dict[StrictStr, Any]] = None,
500
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
501
+ ) -> ApiResponse[List[Dict[str, Optional[object]]]]:
502
+ """List
503
+
504
+ Execute `beet list ...`: return one page of matching tracks (or albums) as JSON objects. The query params (pagination plus the beets query inputs, some repeatable) are documented on `ListQueryParams`. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#list
505
+
506
+ :param page: The page number, 1-indexed.
507
+ :type page: int
508
+ :param page_size: Maximum results per page.
509
+ :type page_size: int
510
+ :param albums: Like `-a`; return albums instead of individual tracks.
511
+ :type albums: bool
512
+ :param keyword: Repeatable bare-keyword query parts (substring match across default fields).
513
+ :type keyword: List[Optional[str]]
514
+ :param var_field: Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).
515
+ :type var_field: List[str]
516
+ :param phrase: A single multi-word phrase part.
517
+ :type phrase: str
518
+ :param filepath: A path within the beets library (becomes a path query).
519
+ :type filepath: str
520
+ :param sort_by: A beets sort token, e.g. `year+` or `artist-`.
521
+ :type sort_by: str
522
+ :param _request_timeout: timeout setting for this request. If one
523
+ number provided, it will be total request
524
+ timeout. It can also be a pair (tuple) of
525
+ (connection, read) timeouts.
526
+ :type _request_timeout: int, tuple(int, int), optional
527
+ :param _request_auth: set to override the auth_settings for an a single
528
+ request; this effectively ignores the
529
+ authentication in the spec for a single request.
530
+ :type _request_auth: dict, optional
531
+ :param _content_type: force content-type for the request.
532
+ :type _content_type: str, Optional
533
+ :param _headers: set to override the headers for a single
534
+ request; this effectively ignores the headers
535
+ in the spec for a single request.
536
+ :type _headers: dict, optional
537
+ :param _host_index: set to override the host_index for a single
538
+ request; this effectively ignores the host_index
539
+ in the spec for a single request.
540
+ :type _host_index: int, optional
541
+ :return: Returns the result object.
542
+ """ # noqa: E501
543
+
544
+ _param = self._list_api_query_list_get_serialize(
545
+ page=page,
546
+ page_size=page_size,
547
+ albums=albums,
548
+ keyword=keyword,
549
+ var_field=var_field,
550
+ phrase=phrase,
551
+ filepath=filepath,
552
+ sort_by=sort_by,
553
+ _request_auth=_request_auth,
554
+ _content_type=_content_type,
555
+ _headers=_headers,
556
+ _host_index=_host_index
557
+ )
558
+
559
+ _response_types_map: Dict[str, Optional[str]] = {
560
+ '200': "List[Dict[str, Optional[object]]]",
561
+ '422': "HTTPValidationError",
562
+ }
563
+ response_data = await self.api_client.call_api(
564
+ *_param,
565
+ _request_timeout=_request_timeout
566
+ )
567
+ await response_data.read()
568
+ return self.api_client.response_deserialize(
569
+ response_data=response_data,
570
+ response_types_map=_response_types_map,
571
+ )
572
+
573
+
574
+ @validate_call
575
+ async def list_api_query_list_get_without_preload_content(
576
+ self,
577
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
578
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
579
+ albums: Annotated[Optional[StrictBool], Field(description="Like `-a`; return albums instead of individual tracks.")] = None,
580
+ keyword: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Repeatable bare-keyword query parts (substring match across default fields).")] = None,
581
+ var_field: Annotated[Optional[List[StrictStr]], Field(description="Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).")] = None,
582
+ phrase: Annotated[Optional[StrictStr], Field(description="A single multi-word phrase part.")] = None,
583
+ filepath: Annotated[Optional[StrictStr], Field(description="A path within the beets library (becomes a path query).")] = None,
584
+ sort_by: Annotated[Optional[StrictStr], Field(description="A beets sort token, e.g. `year+` or `artist-`.")] = None,
585
+ _request_timeout: Union[
586
+ None,
587
+ Annotated[StrictFloat, Field(gt=0)],
588
+ Tuple[
589
+ Annotated[StrictFloat, Field(gt=0)],
590
+ Annotated[StrictFloat, Field(gt=0)]
591
+ ]
592
+ ] = None,
593
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
594
+ _content_type: Optional[StrictStr] = None,
595
+ _headers: Optional[Dict[StrictStr, Any]] = None,
596
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
597
+ ) -> RESTResponseType:
598
+ """List
599
+
600
+ Execute `beet list ...`: return one page of matching tracks (or albums) as JSON objects. The query params (pagination plus the beets query inputs, some repeatable) are documented on `ListQueryParams`. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#list
601
+
602
+ :param page: The page number, 1-indexed.
603
+ :type page: int
604
+ :param page_size: Maximum results per page.
605
+ :type page_size: int
606
+ :param albums: Like `-a`; return albums instead of individual tracks.
607
+ :type albums: bool
608
+ :param keyword: Repeatable bare-keyword query parts (substring match across default fields).
609
+ :type keyword: List[Optional[str]]
610
+ :param var_field: Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).
611
+ :type var_field: List[str]
612
+ :param phrase: A single multi-word phrase part.
613
+ :type phrase: str
614
+ :param filepath: A path within the beets library (becomes a path query).
615
+ :type filepath: str
616
+ :param sort_by: A beets sort token, e.g. `year+` or `artist-`.
617
+ :type sort_by: str
618
+ :param _request_timeout: timeout setting for this request. If one
619
+ number provided, it will be total request
620
+ timeout. It can also be a pair (tuple) of
621
+ (connection, read) timeouts.
622
+ :type _request_timeout: int, tuple(int, int), optional
623
+ :param _request_auth: set to override the auth_settings for an a single
624
+ request; this effectively ignores the
625
+ authentication in the spec for a single request.
626
+ :type _request_auth: dict, optional
627
+ :param _content_type: force content-type for the request.
628
+ :type _content_type: str, Optional
629
+ :param _headers: set to override the headers for a single
630
+ request; this effectively ignores the headers
631
+ in the spec for a single request.
632
+ :type _headers: dict, optional
633
+ :param _host_index: set to override the host_index for a single
634
+ request; this effectively ignores the host_index
635
+ in the spec for a single request.
636
+ :type _host_index: int, optional
637
+ :return: Returns the result object.
638
+ """ # noqa: E501
639
+
640
+ _param = self._list_api_query_list_get_serialize(
641
+ page=page,
642
+ page_size=page_size,
643
+ albums=albums,
644
+ keyword=keyword,
645
+ var_field=var_field,
646
+ phrase=phrase,
647
+ filepath=filepath,
648
+ sort_by=sort_by,
649
+ _request_auth=_request_auth,
650
+ _content_type=_content_type,
651
+ _headers=_headers,
652
+ _host_index=_host_index
653
+ )
654
+
655
+ _response_types_map: Dict[str, Optional[str]] = {
656
+ '200': "List[Dict[str, Optional[object]]]",
657
+ '422': "HTTPValidationError",
658
+ }
659
+ response_data = await self.api_client.call_api(
660
+ *_param,
661
+ _request_timeout=_request_timeout
662
+ )
663
+ return response_data.response
664
+
665
+
666
+ @validate_call
667
+ def list_api_query_list_get_sync(
668
+ self,
669
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
670
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
671
+ albums: Annotated[Optional[StrictBool], Field(description="Like `-a`; return albums instead of individual tracks.")] = None,
672
+ keyword: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Repeatable bare-keyword query parts (substring match across default fields).")] = None,
673
+ var_field: Annotated[Optional[List[StrictStr]], Field(description="Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).")] = None,
674
+ phrase: Annotated[Optional[StrictStr], Field(description="A single multi-word phrase part.")] = None,
675
+ filepath: Annotated[Optional[StrictStr], Field(description="A path within the beets library (becomes a path query).")] = None,
676
+ sort_by: Annotated[Optional[StrictStr], Field(description="A beets sort token, e.g. `year+` or `artist-`.")] = None,
677
+ _request_timeout: Union[
678
+ None,
679
+ Annotated[StrictFloat, Field(gt=0)],
680
+ Tuple[
681
+ Annotated[StrictFloat, Field(gt=0)],
682
+ Annotated[StrictFloat, Field(gt=0)]
683
+ ]
684
+ ] = None,
685
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
686
+ _content_type: Optional[StrictStr] = None,
687
+ _headers: Optional[Dict[StrictStr, Any]] = None,
688
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
689
+ ) -> List[Dict[str, Optional[object]]]:
690
+ """List (synchronous)
691
+
692
+ Synchronous variant of :meth:`list_api_query_list_get`. It calls the asynchronous
693
+ method and blocks until it completes.
694
+ """ # noqa: E501
695
+ return run_sync(
696
+ self.list_api_query_list_get(
697
+ page=page,
698
+ page_size=page_size,
699
+ albums=albums,
700
+ keyword=keyword,
701
+ var_field=var_field,
702
+ phrase=phrase,
703
+ filepath=filepath,
704
+ sort_by=sort_by,
705
+ _request_timeout=_request_timeout,
706
+ _request_auth=_request_auth,
707
+ _content_type=_content_type,
708
+ _headers=_headers,
709
+ _host_index=_host_index,
710
+ )
711
+ )
712
+
713
+
714
+ @validate_call
715
+ def list_api_query_list_get_sync_with_http_info(
716
+ self,
717
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
718
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
719
+ albums: Annotated[Optional[StrictBool], Field(description="Like `-a`; return albums instead of individual tracks.")] = None,
720
+ keyword: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Repeatable bare-keyword query parts (substring match across default fields).")] = None,
721
+ var_field: Annotated[Optional[List[StrictStr]], Field(description="Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).")] = None,
722
+ phrase: Annotated[Optional[StrictStr], Field(description="A single multi-word phrase part.")] = None,
723
+ filepath: Annotated[Optional[StrictStr], Field(description="A path within the beets library (becomes a path query).")] = None,
724
+ sort_by: Annotated[Optional[StrictStr], Field(description="A beets sort token, e.g. `year+` or `artist-`.")] = None,
725
+ _request_timeout: Union[
726
+ None,
727
+ Annotated[StrictFloat, Field(gt=0)],
728
+ Tuple[
729
+ Annotated[StrictFloat, Field(gt=0)],
730
+ Annotated[StrictFloat, Field(gt=0)]
731
+ ]
732
+ ] = None,
733
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
734
+ _content_type: Optional[StrictStr] = None,
735
+ _headers: Optional[Dict[StrictStr, Any]] = None,
736
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
737
+ ) -> ApiResponse[List[Dict[str, Optional[object]]]]:
738
+ """List (synchronous)
739
+
740
+ Synchronous variant of :meth:`list_api_query_list_get_with_http_info`. It calls the
741
+ asynchronous method and blocks until it completes.
742
+ """ # noqa: E501
743
+ return run_sync(
744
+ self.list_api_query_list_get_with_http_info(
745
+ page=page,
746
+ page_size=page_size,
747
+ albums=albums,
748
+ keyword=keyword,
749
+ var_field=var_field,
750
+ phrase=phrase,
751
+ filepath=filepath,
752
+ sort_by=sort_by,
753
+ _request_timeout=_request_timeout,
754
+ _request_auth=_request_auth,
755
+ _content_type=_content_type,
756
+ _headers=_headers,
757
+ _host_index=_host_index,
758
+ )
759
+ )
760
+
761
+
762
+ @validate_call
763
+ def list_api_query_list_get_sync_without_preload_content(
764
+ self,
765
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number, 1-indexed.")] = None,
766
+ page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum results per page.")] = None,
767
+ albums: Annotated[Optional[StrictBool], Field(description="Like `-a`; return albums instead of individual tracks.")] = None,
768
+ keyword: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Repeatable bare-keyword query parts (substring match across default fields).")] = None,
769
+ var_field: Annotated[Optional[List[StrictStr]], Field(description="Repeatable `field:value` parts (exact `=`, regex `::`, numeric/date ranges all supported).")] = None,
770
+ phrase: Annotated[Optional[StrictStr], Field(description="A single multi-word phrase part.")] = None,
771
+ filepath: Annotated[Optional[StrictStr], Field(description="A path within the beets library (becomes a path query).")] = None,
772
+ sort_by: Annotated[Optional[StrictStr], Field(description="A beets sort token, e.g. `year+` or `artist-`.")] = None,
773
+ _request_timeout: Union[
774
+ None,
775
+ Annotated[StrictFloat, Field(gt=0)],
776
+ Tuple[
777
+ Annotated[StrictFloat, Field(gt=0)],
778
+ Annotated[StrictFloat, Field(gt=0)]
779
+ ]
780
+ ] = None,
781
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
782
+ _content_type: Optional[StrictStr] = None,
783
+ _headers: Optional[Dict[StrictStr, Any]] = None,
784
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
785
+ ) -> RESTResponseType:
786
+ """List (synchronous)
787
+
788
+ Synchronous variant of :meth:`list_api_query_list_get_without_preload_content`. It calls
789
+ the asynchronous method and blocks until it completes.
790
+ """ # noqa: E501
791
+ return run_sync(
792
+ self.list_api_query_list_get_without_preload_content(
793
+ page=page,
794
+ page_size=page_size,
795
+ albums=albums,
796
+ keyword=keyword,
797
+ var_field=var_field,
798
+ phrase=phrase,
799
+ filepath=filepath,
800
+ sort_by=sort_by,
801
+ _request_timeout=_request_timeout,
802
+ _request_auth=_request_auth,
803
+ _content_type=_content_type,
804
+ _headers=_headers,
805
+ _host_index=_host_index,
806
+ )
807
+ )
808
+
809
+
810
+ def _list_api_query_list_get_serialize(
811
+ self,
812
+ page,
813
+ page_size,
814
+ albums,
815
+ keyword,
816
+ var_field,
817
+ phrase,
818
+ filepath,
819
+ sort_by,
820
+ _request_auth,
821
+ _content_type,
822
+ _headers,
823
+ _host_index,
824
+ ) -> RequestSerialized:
825
+
826
+ _host = None
827
+
828
+ _collection_formats: Dict[str, str] = {
829
+ 'keyword': 'multi',
830
+ 'field': 'multi',
831
+ }
832
+
833
+ _path_params: Dict[str, str] = {}
834
+ _query_params: List[Tuple[str, str]] = []
835
+ _header_params: Dict[str, Optional[str]] = _headers or {}
836
+ _form_params: List[Tuple[str, str]] = []
837
+ _files: Dict[
838
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
839
+ ] = {}
840
+ _body_params: Optional[bytes] = None
841
+
842
+ # process the path parameters
843
+ # process the query parameters
844
+ if page is not None:
845
+
846
+ _query_params.append(('page', page))
847
+
848
+ if page_size is not None:
849
+
850
+ _query_params.append(('page_size', page_size))
851
+
852
+ if albums is not None:
853
+
854
+ _query_params.append(('albums', albums))
855
+
856
+ if keyword is not None:
857
+
858
+ _query_params.append(('keyword', keyword))
859
+
860
+ if var_field is not None:
861
+
862
+ _query_params.append(('field', var_field))
863
+
864
+ if phrase is not None:
865
+
866
+ _query_params.append(('phrase', phrase))
867
+
868
+ if filepath is not None:
869
+
870
+ _query_params.append(('filepath', filepath))
871
+
872
+ if sort_by is not None:
873
+
874
+ _query_params.append(('sort_by', sort_by))
875
+
876
+ # process the header parameters
877
+ # process the form parameters
878
+ # process the body parameter
879
+
880
+
881
+ # set the HTTP header `Accept`
882
+ if 'Accept' not in _header_params:
883
+ _header_params['Accept'] = self.api_client.select_header_accept(
884
+ [
885
+ 'application/json'
886
+ ]
887
+ )
888
+
889
+
890
+ # authentication setting
891
+ _auth_settings: List[str] = [
892
+ ]
893
+
894
+ return self.api_client.param_serialize(
895
+ method='GET',
896
+ resource_path='/api/query/list',
897
+ path_params=_path_params,
898
+ query_params=_query_params,
899
+ header_params=_header_params,
900
+ body=_body_params,
901
+ post_params=_form_params,
902
+ files=_files,
903
+ auth_settings=_auth_settings,
904
+ collection_formats=_collection_formats,
905
+ _host=_host,
906
+ _request_auth=_request_auth
907
+ )
908
+
909
+
910
+
911
+
912
+ @validate_call
913
+ async def stats_api_query_stats_get(
914
+ self,
915
+ _request_timeout: Union[
916
+ None,
917
+ Annotated[StrictFloat, Field(gt=0)],
918
+ Tuple[
919
+ Annotated[StrictFloat, Field(gt=0)],
920
+ Annotated[StrictFloat, Field(gt=0)]
921
+ ]
922
+ ] = None,
923
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
924
+ _content_type: Optional[StrictStr] = None,
925
+ _headers: Optional[Dict[StrictStr, Any]] = None,
926
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
927
+ ) -> Dict[str, Optional[object]]:
928
+ """Stats
929
+
930
+ Execute `beet stats`: track count, total time, approximate size, and artist/album counts. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#stats
931
+
932
+ :param _request_timeout: timeout setting for this request. If one
933
+ number provided, it will be total request
934
+ timeout. It can also be a pair (tuple) of
935
+ (connection, read) timeouts.
936
+ :type _request_timeout: int, tuple(int, int), optional
937
+ :param _request_auth: set to override the auth_settings for an a single
938
+ request; this effectively ignores the
939
+ authentication in the spec for a single request.
940
+ :type _request_auth: dict, optional
941
+ :param _content_type: force content-type for the request.
942
+ :type _content_type: str, Optional
943
+ :param _headers: set to override the headers for a single
944
+ request; this effectively ignores the headers
945
+ in the spec for a single request.
946
+ :type _headers: dict, optional
947
+ :param _host_index: set to override the host_index for a single
948
+ request; this effectively ignores the host_index
949
+ in the spec for a single request.
950
+ :type _host_index: int, optional
951
+ :return: Returns the result object.
952
+ """ # noqa: E501
953
+
954
+ _param = self._stats_api_query_stats_get_serialize(
955
+ _request_auth=_request_auth,
956
+ _content_type=_content_type,
957
+ _headers=_headers,
958
+ _host_index=_host_index
959
+ )
960
+
961
+ _response_types_map: Dict[str, Optional[str]] = {
962
+ '200': "Dict[str, Optional[object]]",
963
+ }
964
+ response_data = await self.api_client.call_api(
965
+ *_param,
966
+ _request_timeout=_request_timeout
967
+ )
968
+ await response_data.read()
969
+ return self.api_client.response_deserialize(
970
+ response_data=response_data,
971
+ response_types_map=_response_types_map,
972
+ ).data
973
+
974
+
975
+ @validate_call
976
+ async def stats_api_query_stats_get_with_http_info(
977
+ self,
978
+ _request_timeout: Union[
979
+ None,
980
+ Annotated[StrictFloat, Field(gt=0)],
981
+ Tuple[
982
+ Annotated[StrictFloat, Field(gt=0)],
983
+ Annotated[StrictFloat, Field(gt=0)]
984
+ ]
985
+ ] = None,
986
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
987
+ _content_type: Optional[StrictStr] = None,
988
+ _headers: Optional[Dict[StrictStr, Any]] = None,
989
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
990
+ ) -> ApiResponse[Dict[str, Optional[object]]]:
991
+ """Stats
992
+
993
+ Execute `beet stats`: track count, total time, approximate size, and artist/album counts. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#stats
994
+
995
+ :param _request_timeout: timeout setting for this request. If one
996
+ number provided, it will be total request
997
+ timeout. It can also be a pair (tuple) of
998
+ (connection, read) timeouts.
999
+ :type _request_timeout: int, tuple(int, int), optional
1000
+ :param _request_auth: set to override the auth_settings for an a single
1001
+ request; this effectively ignores the
1002
+ authentication in the spec for a single request.
1003
+ :type _request_auth: dict, optional
1004
+ :param _content_type: force content-type for the request.
1005
+ :type _content_type: str, Optional
1006
+ :param _headers: set to override the headers for a single
1007
+ request; this effectively ignores the headers
1008
+ in the spec for a single request.
1009
+ :type _headers: dict, optional
1010
+ :param _host_index: set to override the host_index for a single
1011
+ request; this effectively ignores the host_index
1012
+ in the spec for a single request.
1013
+ :type _host_index: int, optional
1014
+ :return: Returns the result object.
1015
+ """ # noqa: E501
1016
+
1017
+ _param = self._stats_api_query_stats_get_serialize(
1018
+ _request_auth=_request_auth,
1019
+ _content_type=_content_type,
1020
+ _headers=_headers,
1021
+ _host_index=_host_index
1022
+ )
1023
+
1024
+ _response_types_map: Dict[str, Optional[str]] = {
1025
+ '200': "Dict[str, Optional[object]]",
1026
+ }
1027
+ response_data = await self.api_client.call_api(
1028
+ *_param,
1029
+ _request_timeout=_request_timeout
1030
+ )
1031
+ await response_data.read()
1032
+ return self.api_client.response_deserialize(
1033
+ response_data=response_data,
1034
+ response_types_map=_response_types_map,
1035
+ )
1036
+
1037
+
1038
+ @validate_call
1039
+ async def stats_api_query_stats_get_without_preload_content(
1040
+ self,
1041
+ _request_timeout: Union[
1042
+ None,
1043
+ Annotated[StrictFloat, Field(gt=0)],
1044
+ Tuple[
1045
+ Annotated[StrictFloat, Field(gt=0)],
1046
+ Annotated[StrictFloat, Field(gt=0)]
1047
+ ]
1048
+ ] = None,
1049
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1050
+ _content_type: Optional[StrictStr] = None,
1051
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1052
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1053
+ ) -> RESTResponseType:
1054
+ """Stats
1055
+
1056
+ Execute `beet stats`: track count, total time, approximate size, and artist/album counts. See: https://beets.readthedocs.io/en/v2.12.0/reference/cli.html#stats
1057
+
1058
+ :param _request_timeout: timeout setting for this request. If one
1059
+ number provided, it will be total request
1060
+ timeout. It can also be a pair (tuple) of
1061
+ (connection, read) timeouts.
1062
+ :type _request_timeout: int, tuple(int, int), optional
1063
+ :param _request_auth: set to override the auth_settings for an a single
1064
+ request; this effectively ignores the
1065
+ authentication in the spec for a single request.
1066
+ :type _request_auth: dict, optional
1067
+ :param _content_type: force content-type for the request.
1068
+ :type _content_type: str, Optional
1069
+ :param _headers: set to override the headers for a single
1070
+ request; this effectively ignores the headers
1071
+ in the spec for a single request.
1072
+ :type _headers: dict, optional
1073
+ :param _host_index: set to override the host_index for a single
1074
+ request; this effectively ignores the host_index
1075
+ in the spec for a single request.
1076
+ :type _host_index: int, optional
1077
+ :return: Returns the result object.
1078
+ """ # noqa: E501
1079
+
1080
+ _param = self._stats_api_query_stats_get_serialize(
1081
+ _request_auth=_request_auth,
1082
+ _content_type=_content_type,
1083
+ _headers=_headers,
1084
+ _host_index=_host_index
1085
+ )
1086
+
1087
+ _response_types_map: Dict[str, Optional[str]] = {
1088
+ '200': "Dict[str, Optional[object]]",
1089
+ }
1090
+ response_data = await self.api_client.call_api(
1091
+ *_param,
1092
+ _request_timeout=_request_timeout
1093
+ )
1094
+ return response_data.response
1095
+
1096
+
1097
+ @validate_call
1098
+ def stats_api_query_stats_get_sync(
1099
+ self,
1100
+ _request_timeout: Union[
1101
+ None,
1102
+ Annotated[StrictFloat, Field(gt=0)],
1103
+ Tuple[
1104
+ Annotated[StrictFloat, Field(gt=0)],
1105
+ Annotated[StrictFloat, Field(gt=0)]
1106
+ ]
1107
+ ] = None,
1108
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1109
+ _content_type: Optional[StrictStr] = None,
1110
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1111
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1112
+ ) -> Dict[str, Optional[object]]:
1113
+ """Stats (synchronous)
1114
+
1115
+ Synchronous variant of :meth:`stats_api_query_stats_get`. It calls the asynchronous
1116
+ method and blocks until it completes.
1117
+ """ # noqa: E501
1118
+ return run_sync(
1119
+ self.stats_api_query_stats_get(
1120
+ _request_timeout=_request_timeout,
1121
+ _request_auth=_request_auth,
1122
+ _content_type=_content_type,
1123
+ _headers=_headers,
1124
+ _host_index=_host_index,
1125
+ )
1126
+ )
1127
+
1128
+
1129
+ @validate_call
1130
+ def stats_api_query_stats_get_sync_with_http_info(
1131
+ self,
1132
+ _request_timeout: Union[
1133
+ None,
1134
+ Annotated[StrictFloat, Field(gt=0)],
1135
+ Tuple[
1136
+ Annotated[StrictFloat, Field(gt=0)],
1137
+ Annotated[StrictFloat, Field(gt=0)]
1138
+ ]
1139
+ ] = None,
1140
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1141
+ _content_type: Optional[StrictStr] = None,
1142
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1143
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1144
+ ) -> ApiResponse[Dict[str, Optional[object]]]:
1145
+ """Stats (synchronous)
1146
+
1147
+ Synchronous variant of :meth:`stats_api_query_stats_get_with_http_info`. It calls the
1148
+ asynchronous method and blocks until it completes.
1149
+ """ # noqa: E501
1150
+ return run_sync(
1151
+ self.stats_api_query_stats_get_with_http_info(
1152
+ _request_timeout=_request_timeout,
1153
+ _request_auth=_request_auth,
1154
+ _content_type=_content_type,
1155
+ _headers=_headers,
1156
+ _host_index=_host_index,
1157
+ )
1158
+ )
1159
+
1160
+
1161
+ @validate_call
1162
+ def stats_api_query_stats_get_sync_without_preload_content(
1163
+ self,
1164
+ _request_timeout: Union[
1165
+ None,
1166
+ Annotated[StrictFloat, Field(gt=0)],
1167
+ Tuple[
1168
+ Annotated[StrictFloat, Field(gt=0)],
1169
+ Annotated[StrictFloat, Field(gt=0)]
1170
+ ]
1171
+ ] = None,
1172
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1173
+ _content_type: Optional[StrictStr] = None,
1174
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1175
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1176
+ ) -> RESTResponseType:
1177
+ """Stats (synchronous)
1178
+
1179
+ Synchronous variant of :meth:`stats_api_query_stats_get_without_preload_content`. It calls
1180
+ the asynchronous method and blocks until it completes.
1181
+ """ # noqa: E501
1182
+ return run_sync(
1183
+ self.stats_api_query_stats_get_without_preload_content(
1184
+ _request_timeout=_request_timeout,
1185
+ _request_auth=_request_auth,
1186
+ _content_type=_content_type,
1187
+ _headers=_headers,
1188
+ _host_index=_host_index,
1189
+ )
1190
+ )
1191
+
1192
+
1193
+ def _stats_api_query_stats_get_serialize(
1194
+ self,
1195
+ _request_auth,
1196
+ _content_type,
1197
+ _headers,
1198
+ _host_index,
1199
+ ) -> RequestSerialized:
1200
+
1201
+ _host = None
1202
+
1203
+ _collection_formats: Dict[str, str] = {
1204
+ }
1205
+
1206
+ _path_params: Dict[str, str] = {}
1207
+ _query_params: List[Tuple[str, str]] = []
1208
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1209
+ _form_params: List[Tuple[str, str]] = []
1210
+ _files: Dict[
1211
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1212
+ ] = {}
1213
+ _body_params: Optional[bytes] = None
1214
+
1215
+ # process the path parameters
1216
+ # process the query parameters
1217
+ # process the header parameters
1218
+ # process the form parameters
1219
+ # process the body parameter
1220
+
1221
+
1222
+ # set the HTTP header `Accept`
1223
+ if 'Accept' not in _header_params:
1224
+ _header_params['Accept'] = self.api_client.select_header_accept(
1225
+ [
1226
+ 'application/json'
1227
+ ]
1228
+ )
1229
+
1230
+
1231
+ # authentication setting
1232
+ _auth_settings: List[str] = [
1233
+ ]
1234
+
1235
+ return self.api_client.param_serialize(
1236
+ method='GET',
1237
+ resource_path='/api/query/stats',
1238
+ path_params=_path_params,
1239
+ query_params=_query_params,
1240
+ header_params=_header_params,
1241
+ body=_body_params,
1242
+ post_params=_form_params,
1243
+ files=_files,
1244
+ auth_settings=_auth_settings,
1245
+ collection_formats=_collection_formats,
1246
+ _host=_host,
1247
+ _request_auth=_request_auth
1248
+ )
1249
+
1250
+