pulp-python-client 3.32.0__py3-none-any.whl → 3.33.0__py3-none-any.whl

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