crc-pulp-file-client 20251209.2__py3-none-any.whl

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

Potentially problematic release.


This version of crc-pulp-file-client might be problematic. Click here for more details.

Files changed (62) hide show
  1. crc_pulp_file_client-20251209.2.dist-info/METADATA +8160 -0
  2. crc_pulp_file_client-20251209.2.dist-info/RECORD +62 -0
  3. crc_pulp_file_client-20251209.2.dist-info/WHEEL +5 -0
  4. crc_pulp_file_client-20251209.2.dist-info/top_level.txt +1 -0
  5. pulpcore/__init__.py +2 -0
  6. pulpcore/client/__init__.py +2 -0
  7. pulpcore/client/pulp_file/__init__.py +80 -0
  8. pulpcore/client/pulp_file/api/__init__.py +11 -0
  9. pulpcore/client/pulp_file/api/acs_file_api.py +3695 -0
  10. pulpcore/client/pulp_file/api/content_files_api.py +2472 -0
  11. pulpcore/client/pulp_file/api/distributions_file_api.py +4192 -0
  12. pulpcore/client/pulp_file/api/publications_file_api.py +2881 -0
  13. pulpcore/client/pulp_file/api/remotes_file_api.py +4220 -0
  14. pulpcore/client/pulp_file/api/repositories_file_api.py +4862 -0
  15. pulpcore/client/pulp_file/api/repositories_file_versions_api.py +1670 -0
  16. pulpcore/client/pulp_file/api_client.py +798 -0
  17. pulpcore/client/pulp_file/api_response.py +21 -0
  18. pulpcore/client/pulp_file/configuration.py +628 -0
  19. pulpcore/client/pulp_file/exceptions.py +200 -0
  20. pulpcore/client/pulp_file/models/__init__.py +57 -0
  21. pulpcore/client/pulp_file/models/async_operation_response.py +88 -0
  22. pulpcore/client/pulp_file/models/content_summary_response.py +92 -0
  23. pulpcore/client/pulp_file/models/file_content_upload_response.py +137 -0
  24. pulpcore/client/pulp_file/models/file_file_alternate_content_source.py +101 -0
  25. pulpcore/client/pulp_file/models/file_file_alternate_content_source_response.py +116 -0
  26. pulpcore/client/pulp_file/models/file_file_content_response.py +137 -0
  27. pulpcore/client/pulp_file/models/file_file_distribution.py +118 -0
  28. pulpcore/client/pulp_file/models/file_file_distribution_response.py +142 -0
  29. pulpcore/client/pulp_file/models/file_file_publication.py +100 -0
  30. pulpcore/client/pulp_file/models/file_file_publication_response.py +120 -0
  31. pulpcore/client/pulp_file/models/file_file_remote.py +205 -0
  32. pulpcore/client/pulp_file/models/file_file_remote_response.py +199 -0
  33. pulpcore/client/pulp_file/models/file_file_remote_response_hidden_fields_inner.py +90 -0
  34. pulpcore/client/pulp_file/models/file_file_repository.py +121 -0
  35. pulpcore/client/pulp_file/models/file_file_repository_response.py +146 -0
  36. pulpcore/client/pulp_file/models/my_permissions_response.py +88 -0
  37. pulpcore/client/pulp_file/models/nested_role.py +93 -0
  38. pulpcore/client/pulp_file/models/nested_role_response.py +92 -0
  39. pulpcore/client/pulp_file/models/object_roles_response.py +96 -0
  40. pulpcore/client/pulp_file/models/paginated_repository_version_response_list.py +112 -0
  41. pulpcore/client/pulp_file/models/paginatedfile_file_alternate_content_source_response_list.py +112 -0
  42. pulpcore/client/pulp_file/models/paginatedfile_file_content_response_list.py +112 -0
  43. pulpcore/client/pulp_file/models/paginatedfile_file_distribution_response_list.py +112 -0
  44. pulpcore/client/pulp_file/models/paginatedfile_file_publication_response_list.py +112 -0
  45. pulpcore/client/pulp_file/models/paginatedfile_file_remote_response_list.py +112 -0
  46. pulpcore/client/pulp_file/models/paginatedfile_file_repository_response_list.py +112 -0
  47. pulpcore/client/pulp_file/models/patchedfile_file_alternate_content_source.py +101 -0
  48. pulpcore/client/pulp_file/models/patchedfile_file_distribution.py +118 -0
  49. pulpcore/client/pulp_file/models/patchedfile_file_remote.py +205 -0
  50. pulpcore/client/pulp_file/models/patchedfile_file_repository.py +121 -0
  51. pulpcore/client/pulp_file/models/policy_enum.py +39 -0
  52. pulpcore/client/pulp_file/models/repair.py +88 -0
  53. pulpcore/client/pulp_file/models/repository_add_remove_content.py +93 -0
  54. pulpcore/client/pulp_file/models/repository_sync_url.py +90 -0
  55. pulpcore/client/pulp_file/models/repository_version_response.py +125 -0
  56. pulpcore/client/pulp_file/models/set_label.py +103 -0
  57. pulpcore/client/pulp_file/models/set_label_response.py +103 -0
  58. pulpcore/client/pulp_file/models/task_group_operation_response.py +88 -0
  59. pulpcore/client/pulp_file/models/unset_label.py +96 -0
  60. pulpcore/client/pulp_file/models/unset_label_response.py +100 -0
  61. pulpcore/client/pulp_file/py.typed +0 -0
  62. pulpcore/client/pulp_file/rest.py +258 -0
@@ -0,0 +1,2472 @@
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, StrictBytes, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from typing import Dict, List, Optional, Tuple, Union
22
+ from typing_extensions import Annotated
23
+ from pulpcore.client.pulp_file.models.async_operation_response import AsyncOperationResponse
24
+ from pulpcore.client.pulp_file.models.file_content_upload_response import FileContentUploadResponse
25
+ from pulpcore.client.pulp_file.models.file_file_content_response import FileFileContentResponse
26
+ from pulpcore.client.pulp_file.models.paginatedfile_file_content_response_list import PaginatedfileFileContentResponseList
27
+ from pulpcore.client.pulp_file.models.set_label import SetLabel
28
+ from pulpcore.client.pulp_file.models.set_label_response import SetLabelResponse
29
+ from pulpcore.client.pulp_file.models.unset_label import UnsetLabel
30
+ from pulpcore.client.pulp_file.models.unset_label_response import UnsetLabelResponse
31
+
32
+ from pulpcore.client.pulp_file.api_client import ApiClient, RequestSerialized
33
+ from pulpcore.client.pulp_file.api_response import ApiResponse
34
+ from pulpcore.client.pulp_file.rest import RESTResponseType
35
+
36
+
37
+ class ContentFilesApi:
38
+ """NOTE: This class is auto generated by OpenAPI Generator
39
+ Ref: https://openapi-generator.tech
40
+
41
+ Do not edit the class manually.
42
+ """
43
+
44
+ def __init__(self, api_client=None) -> None:
45
+ if api_client is None:
46
+ api_client = ApiClient.get_default()
47
+ self.api_client = api_client
48
+
49
+
50
+ @validate_call
51
+ def create(
52
+ self,
53
+ relative_path: Annotated[str, Field(min_length=1, strict=True, description="Path where the artifact is located relative to distributions base_path")],
54
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
55
+ repository: Annotated[Optional[StrictStr], Field(description="A URI of a repository the new content unit should be associated with.")] = None,
56
+ pulp_labels: Annotated[Optional[Dict[str, Optional[StrictStr]]], Field(description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")] = None,
57
+ artifact: Annotated[Optional[StrictStr], Field(description="Artifact file representing the physical content")] = None,
58
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="An uploaded file that may be turned into the content unit.")] = None,
59
+ upload: Annotated[Optional[StrictStr], Field(description="An uncommitted upload that may be turned into the content unit.")] = None,
60
+ file_url: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="A url that Pulp can download and turn into the content unit.")] = None,
61
+ pulp_domain: StrictStr = "default",
62
+ _request_timeout: Union[
63
+ None,
64
+ Annotated[StrictFloat, Field(gt=0)],
65
+ Tuple[
66
+ Annotated[StrictFloat, Field(gt=0)],
67
+ Annotated[StrictFloat, Field(gt=0)]
68
+ ]
69
+ ] = None,
70
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
71
+ _content_type: Optional[StrictStr] = None,
72
+ _headers: Optional[Dict[StrictStr, Any]] = None,
73
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
74
+ ) -> AsyncOperationResponse:
75
+ """Create a file content
76
+
77
+ Trigger an asynchronous task to create content,optionally create new repository version.
78
+
79
+ :param pulp_domain: (required)
80
+ :type pulp_domain: str
81
+ :param relative_path: Path where the artifact is located relative to distributions base_path (required)
82
+ :type relative_path: str
83
+ :param x_task_diagnostics: List of profilers to use on tasks.
84
+ :type x_task_diagnostics: List[str]
85
+ :param repository: A URI of a repository the new content unit should be associated with.
86
+ :type repository: str
87
+ :param pulp_labels: A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
88
+ :type pulp_labels: Dict[str, Optional[str]]
89
+ :param artifact: Artifact file representing the physical content
90
+ :type artifact: str
91
+ :param file: An uploaded file that may be turned into the content unit.
92
+ :type file: bytearray
93
+ :param upload: An uncommitted upload that may be turned into the content unit.
94
+ :type upload: str
95
+ :param file_url: A url that Pulp can download and turn into the content unit.
96
+ :type file_url: str
97
+ :param _request_timeout: timeout setting for this request. If one
98
+ number provided, it will be total request
99
+ timeout. It can also be a pair (tuple) of
100
+ (connection, read) timeouts.
101
+ :type _request_timeout: int, tuple(int, int), optional
102
+ :param _request_auth: set to override the auth_settings for an a single
103
+ request; this effectively ignores the
104
+ authentication in the spec for a single request.
105
+ :type _request_auth: dict, optional
106
+ :param _content_type: force content-type for the request.
107
+ :type _content_type: str, Optional
108
+ :param _headers: set to override the headers for a single
109
+ request; this effectively ignores the headers
110
+ in the spec for a single request.
111
+ :type _headers: dict, optional
112
+ :param _host_index: set to override the host_index for a single
113
+ request; this effectively ignores the host_index
114
+ in the spec for a single request.
115
+ :type _host_index: int, optional
116
+ :return: Returns the result object.
117
+ """ # noqa: E501
118
+
119
+ _param = self._create_serialize(
120
+ pulp_domain=pulp_domain,
121
+ relative_path=relative_path,
122
+ x_task_diagnostics=x_task_diagnostics,
123
+ repository=repository,
124
+ pulp_labels=pulp_labels,
125
+ artifact=artifact,
126
+ file=file,
127
+ upload=upload,
128
+ file_url=file_url,
129
+ _request_auth=_request_auth,
130
+ _content_type=_content_type,
131
+ _headers=_headers,
132
+ _host_index=_host_index
133
+ )
134
+
135
+ _response_types_map: Dict[str, Optional[str]] = {
136
+ '202': "AsyncOperationResponse",
137
+ }
138
+ response_data = self.api_client.call_api(
139
+ *_param,
140
+ _request_timeout=_request_timeout
141
+ )
142
+ response_data.read()
143
+ return self.api_client.response_deserialize(
144
+ response_data=response_data,
145
+ response_types_map=_response_types_map,
146
+ ).data
147
+
148
+
149
+ @validate_call
150
+ def create_with_http_info(
151
+ self,
152
+ relative_path: Annotated[str, Field(min_length=1, strict=True, description="Path where the artifact is located relative to distributions base_path")],
153
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
154
+ repository: Annotated[Optional[StrictStr], Field(description="A URI of a repository the new content unit should be associated with.")] = None,
155
+ pulp_labels: Annotated[Optional[Dict[str, Optional[StrictStr]]], Field(description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")] = None,
156
+ artifact: Annotated[Optional[StrictStr], Field(description="Artifact file representing the physical content")] = None,
157
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="An uploaded file that may be turned into the content unit.")] = None,
158
+ upload: Annotated[Optional[StrictStr], Field(description="An uncommitted upload that may be turned into the content unit.")] = None,
159
+ file_url: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="A url that Pulp can download and turn into the content unit.")] = None,
160
+ pulp_domain: StrictStr = "default",
161
+ _request_timeout: Union[
162
+ None,
163
+ Annotated[StrictFloat, Field(gt=0)],
164
+ Tuple[
165
+ Annotated[StrictFloat, Field(gt=0)],
166
+ Annotated[StrictFloat, Field(gt=0)]
167
+ ]
168
+ ] = None,
169
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
170
+ _content_type: Optional[StrictStr] = None,
171
+ _headers: Optional[Dict[StrictStr, Any]] = None,
172
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
173
+ ) -> ApiResponse[AsyncOperationResponse]:
174
+ """Create a file content
175
+
176
+ Trigger an asynchronous task to create content,optionally create new repository version.
177
+
178
+ :param pulp_domain: (required)
179
+ :type pulp_domain: str
180
+ :param relative_path: Path where the artifact is located relative to distributions base_path (required)
181
+ :type relative_path: str
182
+ :param x_task_diagnostics: List of profilers to use on tasks.
183
+ :type x_task_diagnostics: List[str]
184
+ :param repository: A URI of a repository the new content unit should be associated with.
185
+ :type repository: str
186
+ :param pulp_labels: A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
187
+ :type pulp_labels: Dict[str, Optional[str]]
188
+ :param artifact: Artifact file representing the physical content
189
+ :type artifact: str
190
+ :param file: An uploaded file that may be turned into the content unit.
191
+ :type file: bytearray
192
+ :param upload: An uncommitted upload that may be turned into the content unit.
193
+ :type upload: str
194
+ :param file_url: A url that Pulp can download and turn into the content unit.
195
+ :type file_url: str
196
+ :param _request_timeout: timeout setting for this request. If one
197
+ number provided, it will be total request
198
+ timeout. It can also be a pair (tuple) of
199
+ (connection, read) timeouts.
200
+ :type _request_timeout: int, tuple(int, int), optional
201
+ :param _request_auth: set to override the auth_settings for an a single
202
+ request; this effectively ignores the
203
+ authentication in the spec for a single request.
204
+ :type _request_auth: dict, optional
205
+ :param _content_type: force content-type for the request.
206
+ :type _content_type: str, Optional
207
+ :param _headers: set to override the headers for a single
208
+ request; this effectively ignores the headers
209
+ in the spec for a single request.
210
+ :type _headers: dict, optional
211
+ :param _host_index: set to override the host_index for a single
212
+ request; this effectively ignores the host_index
213
+ in the spec for a single request.
214
+ :type _host_index: int, optional
215
+ :return: Returns the result object.
216
+ """ # noqa: E501
217
+
218
+ _param = self._create_serialize(
219
+ pulp_domain=pulp_domain,
220
+ relative_path=relative_path,
221
+ x_task_diagnostics=x_task_diagnostics,
222
+ repository=repository,
223
+ pulp_labels=pulp_labels,
224
+ artifact=artifact,
225
+ file=file,
226
+ upload=upload,
227
+ file_url=file_url,
228
+ _request_auth=_request_auth,
229
+ _content_type=_content_type,
230
+ _headers=_headers,
231
+ _host_index=_host_index
232
+ )
233
+
234
+ _response_types_map: Dict[str, Optional[str]] = {
235
+ '202': "AsyncOperationResponse",
236
+ }
237
+ response_data = self.api_client.call_api(
238
+ *_param,
239
+ _request_timeout=_request_timeout
240
+ )
241
+ response_data.read()
242
+ return self.api_client.response_deserialize(
243
+ response_data=response_data,
244
+ response_types_map=_response_types_map,
245
+ )
246
+
247
+
248
+ @validate_call
249
+ def create_without_preload_content(
250
+ self,
251
+ relative_path: Annotated[str, Field(min_length=1, strict=True, description="Path where the artifact is located relative to distributions base_path")],
252
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
253
+ repository: Annotated[Optional[StrictStr], Field(description="A URI of a repository the new content unit should be associated with.")] = None,
254
+ pulp_labels: Annotated[Optional[Dict[str, Optional[StrictStr]]], Field(description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")] = None,
255
+ artifact: Annotated[Optional[StrictStr], Field(description="Artifact file representing the physical content")] = None,
256
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="An uploaded file that may be turned into the content unit.")] = None,
257
+ upload: Annotated[Optional[StrictStr], Field(description="An uncommitted upload that may be turned into the content unit.")] = None,
258
+ file_url: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="A url that Pulp can download and turn into the content unit.")] = None,
259
+ pulp_domain: StrictStr = "default",
260
+ _request_timeout: Union[
261
+ None,
262
+ Annotated[StrictFloat, Field(gt=0)],
263
+ Tuple[
264
+ Annotated[StrictFloat, Field(gt=0)],
265
+ Annotated[StrictFloat, Field(gt=0)]
266
+ ]
267
+ ] = None,
268
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
269
+ _content_type: Optional[StrictStr] = None,
270
+ _headers: Optional[Dict[StrictStr, Any]] = None,
271
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
272
+ ) -> RESTResponseType:
273
+ """Create a file content
274
+
275
+ Trigger an asynchronous task to create content,optionally create new repository version.
276
+
277
+ :param pulp_domain: (required)
278
+ :type pulp_domain: str
279
+ :param relative_path: Path where the artifact is located relative to distributions base_path (required)
280
+ :type relative_path: str
281
+ :param x_task_diagnostics: List of profilers to use on tasks.
282
+ :type x_task_diagnostics: List[str]
283
+ :param repository: A URI of a repository the new content unit should be associated with.
284
+ :type repository: str
285
+ :param pulp_labels: A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
286
+ :type pulp_labels: Dict[str, Optional[str]]
287
+ :param artifact: Artifact file representing the physical content
288
+ :type artifact: str
289
+ :param file: An uploaded file that may be turned into the content unit.
290
+ :type file: bytearray
291
+ :param upload: An uncommitted upload that may be turned into the content unit.
292
+ :type upload: str
293
+ :param file_url: A url that Pulp can download and turn into the content unit.
294
+ :type file_url: str
295
+ :param _request_timeout: timeout setting for this request. If one
296
+ number provided, it will be total request
297
+ timeout. It can also be a pair (tuple) of
298
+ (connection, read) timeouts.
299
+ :type _request_timeout: int, tuple(int, int), optional
300
+ :param _request_auth: set to override the auth_settings for an a single
301
+ request; this effectively ignores the
302
+ authentication in the spec for a single request.
303
+ :type _request_auth: dict, optional
304
+ :param _content_type: force content-type for the request.
305
+ :type _content_type: str, Optional
306
+ :param _headers: set to override the headers for a single
307
+ request; this effectively ignores the headers
308
+ in the spec for a single request.
309
+ :type _headers: dict, optional
310
+ :param _host_index: set to override the host_index for a single
311
+ request; this effectively ignores the host_index
312
+ in the spec for a single request.
313
+ :type _host_index: int, optional
314
+ :return: Returns the result object.
315
+ """ # noqa: E501
316
+
317
+ _param = self._create_serialize(
318
+ pulp_domain=pulp_domain,
319
+ relative_path=relative_path,
320
+ x_task_diagnostics=x_task_diagnostics,
321
+ repository=repository,
322
+ pulp_labels=pulp_labels,
323
+ artifact=artifact,
324
+ file=file,
325
+ upload=upload,
326
+ file_url=file_url,
327
+ _request_auth=_request_auth,
328
+ _content_type=_content_type,
329
+ _headers=_headers,
330
+ _host_index=_host_index
331
+ )
332
+
333
+ _response_types_map: Dict[str, Optional[str]] = {
334
+ '202': "AsyncOperationResponse",
335
+ }
336
+ response_data = self.api_client.call_api(
337
+ *_param,
338
+ _request_timeout=_request_timeout
339
+ )
340
+ return response_data.response
341
+
342
+
343
+ def _create_serialize(
344
+ self,
345
+ pulp_domain,
346
+ relative_path,
347
+ x_task_diagnostics,
348
+ repository,
349
+ pulp_labels,
350
+ artifact,
351
+ file,
352
+ upload,
353
+ file_url,
354
+ _request_auth,
355
+ _content_type,
356
+ _headers,
357
+ _host_index,
358
+ ) -> RequestSerialized:
359
+
360
+ _host = None
361
+
362
+ _collection_formats: Dict[str, str] = {
363
+ 'X-Task-Diagnostics': 'csv',
364
+ }
365
+
366
+ _path_params: Dict[str, str] = {}
367
+ _query_params: List[Tuple[str, str]] = []
368
+ _header_params: Dict[str, Optional[str]] = _headers or {}
369
+ _form_params: List[Tuple[str, str]] = []
370
+ _files: Dict[
371
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
372
+ ] = {}
373
+ _body_params: Optional[bytes] = None
374
+
375
+ # process the path parameters
376
+ if pulp_domain is not None:
377
+ _path_params['pulp_domain'] = pulp_domain
378
+ # process the query parameters
379
+ # process the header parameters
380
+ if x_task_diagnostics is not None:
381
+ _header_params['X-Task-Diagnostics'] = x_task_diagnostics
382
+ # process the form parameters
383
+ if repository is not None:
384
+ _form_params.append(('repository', repository))
385
+ if pulp_labels is not None:
386
+ _form_params.append(('pulp_labels', pulp_labels))
387
+ if artifact is not None:
388
+ _form_params.append(('artifact', artifact))
389
+ if relative_path is not None:
390
+ _form_params.append(('relative_path', relative_path))
391
+ if file is not None:
392
+ _files['file'] = file
393
+ if upload is not None:
394
+ _form_params.append(('upload', upload))
395
+ if file_url is not None:
396
+ _form_params.append(('file_url', file_url))
397
+ # process the body parameter
398
+
399
+
400
+ # set the HTTP header `Accept`
401
+ if 'Accept' not in _header_params:
402
+ _header_params['Accept'] = self.api_client.select_header_accept(
403
+ [
404
+ 'application/json'
405
+ ]
406
+ )
407
+
408
+ # set the HTTP header `Content-Type`
409
+ if _content_type:
410
+ _header_params['Content-Type'] = _content_type
411
+ else:
412
+ _default_content_type = (
413
+ self.api_client.select_header_content_type(
414
+ [
415
+ 'multipart/form-data',
416
+ 'application/x-www-form-urlencoded'
417
+ ]
418
+ )
419
+ )
420
+ if _default_content_type is not None:
421
+ _header_params['Content-Type'] = _default_content_type
422
+
423
+ # authentication setting
424
+ _auth_settings: List[str] = [
425
+ 'json_header_remote_authentication',
426
+ 'basicAuth',
427
+ 'cookieAuth'
428
+ ]
429
+
430
+ return self.api_client.param_serialize(
431
+ method='POST',
432
+ resource_path='/api/pulp/{pulp_domain}/api/v3/content/file/files/',
433
+ path_params=_path_params,
434
+ query_params=_query_params,
435
+ header_params=_header_params,
436
+ body=_body_params,
437
+ post_params=_form_params,
438
+ files=_files,
439
+ auth_settings=_auth_settings,
440
+ collection_formats=_collection_formats,
441
+ _host=_host,
442
+ _request_auth=_request_auth
443
+ )
444
+
445
+
446
+
447
+
448
+ @validate_call
449
+ def list(
450
+ self,
451
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
452
+ digest: Annotated[Optional[StrictStr], Field(description="Filter results where digest matches value")] = None,
453
+ limit: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
454
+ offset: Annotated[Optional[StrictInt], Field(description="The initial index from which to return the results.")] = None,
455
+ ordering: Annotated[Optional[List[StrictStr]], Field(description="Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `pulp_labels` - Pulp labels * `-pulp_labels` - Pulp labels (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `relative_path` - Relative path * `-relative_path` - Relative path (descending) * `digest` - Digest * `-digest` - Digest (descending) * `pk` - Pk * `-pk` - Pk (descending)")] = None,
456
+ orphaned_for: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.")] = None,
457
+ prn__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
458
+ pulp_href__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
459
+ pulp_id__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
460
+ pulp_label_select: Annotated[Optional[StrictStr], Field(description="Filter labels by search string")] = None,
461
+ q: Annotated[Optional[StrictStr], Field(description="Filter results by using NOT, AND and OR operations on other filters")] = None,
462
+ relative_path: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches value")] = None,
463
+ relative_path__contains: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path contains value")] = None,
464
+ relative_path__icontains: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path contains value")] = None,
465
+ relative_path__iexact: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches value")] = None,
466
+ relative_path__in: Annotated[Optional[List[StrictStr]], Field(description="Filter results where relative_path is in a comma-separated list of values")] = None,
467
+ relative_path__iregex: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches regex value")] = None,
468
+ relative_path__istartswith: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path starts with value")] = None,
469
+ relative_path__regex: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches regex value")] = None,
470
+ relative_path__startswith: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path starts with value")] = None,
471
+ repository_version: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
472
+ repository_version_added: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
473
+ repository_version_removed: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
474
+ sha256: Optional[StrictStr] = None,
475
+ fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to include in the response.")] = None,
476
+ exclude_fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to exclude from the response.")] = None,
477
+ pulp_domain: StrictStr = "default",
478
+ _request_timeout: Union[
479
+ None,
480
+ Annotated[StrictFloat, Field(gt=0)],
481
+ Tuple[
482
+ Annotated[StrictFloat, Field(gt=0)],
483
+ Annotated[StrictFloat, Field(gt=0)]
484
+ ]
485
+ ] = None,
486
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
487
+ _content_type: Optional[StrictStr] = None,
488
+ _headers: Optional[Dict[StrictStr, Any]] = None,
489
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
490
+ ) -> PaginatedfileFileContentResponseList:
491
+ """List file contents
492
+
493
+ FileContent represents a single file and its metadata, which can be added and removed from repositories.
494
+
495
+ :param pulp_domain: (required)
496
+ :type pulp_domain: str
497
+ :param x_task_diagnostics: List of profilers to use on tasks.
498
+ :type x_task_diagnostics: List[str]
499
+ :param digest: Filter results where digest matches value
500
+ :type digest: str
501
+ :param limit: Number of results to return per page.
502
+ :type limit: int
503
+ :param offset: The initial index from which to return the results.
504
+ :type offset: int
505
+ :param ordering: Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `pulp_labels` - Pulp labels * `-pulp_labels` - Pulp labels (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `relative_path` - Relative path * `-relative_path` - Relative path (descending) * `digest` - Digest * `-digest` - Digest (descending) * `pk` - Pk * `-pk` - Pk (descending)
506
+ :type ordering: List[str]
507
+ :param orphaned_for: Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.
508
+ :type orphaned_for: float
509
+ :param prn__in: Multiple values may be separated by commas.
510
+ :type prn__in: List[str]
511
+ :param pulp_href__in: Multiple values may be separated by commas.
512
+ :type pulp_href__in: List[str]
513
+ :param pulp_id__in: Multiple values may be separated by commas.
514
+ :type pulp_id__in: List[str]
515
+ :param pulp_label_select: Filter labels by search string
516
+ :type pulp_label_select: str
517
+ :param q: Filter results by using NOT, AND and OR operations on other filters
518
+ :type q: str
519
+ :param relative_path: Filter results where relative_path matches value
520
+ :type relative_path: str
521
+ :param relative_path__contains: Filter results where relative_path contains value
522
+ :type relative_path__contains: str
523
+ :param relative_path__icontains: Filter results where relative_path contains value
524
+ :type relative_path__icontains: str
525
+ :param relative_path__iexact: Filter results where relative_path matches value
526
+ :type relative_path__iexact: str
527
+ :param relative_path__in: Filter results where relative_path is in a comma-separated list of values
528
+ :type relative_path__in: List[str]
529
+ :param relative_path__iregex: Filter results where relative_path matches regex value
530
+ :type relative_path__iregex: str
531
+ :param relative_path__istartswith: Filter results where relative_path starts with value
532
+ :type relative_path__istartswith: str
533
+ :param relative_path__regex: Filter results where relative_path matches regex value
534
+ :type relative_path__regex: str
535
+ :param relative_path__startswith: Filter results where relative_path starts with value
536
+ :type relative_path__startswith: str
537
+ :param repository_version: Repository Version referenced by HREF/PRN
538
+ :type repository_version: str
539
+ :param repository_version_added: Repository Version referenced by HREF/PRN
540
+ :type repository_version_added: str
541
+ :param repository_version_removed: Repository Version referenced by HREF/PRN
542
+ :type repository_version_removed: str
543
+ :param sha256:
544
+ :type sha256: str
545
+ :param fields: A list of fields to include in the response.
546
+ :type fields: List[str]
547
+ :param exclude_fields: A list of fields to exclude from the response.
548
+ :type exclude_fields: List[str]
549
+ :param _request_timeout: timeout setting for this request. If one
550
+ number provided, it will be total request
551
+ timeout. It can also be a pair (tuple) of
552
+ (connection, read) timeouts.
553
+ :type _request_timeout: int, tuple(int, int), optional
554
+ :param _request_auth: set to override the auth_settings for an a single
555
+ request; this effectively ignores the
556
+ authentication in the spec for a single request.
557
+ :type _request_auth: dict, optional
558
+ :param _content_type: force content-type for the request.
559
+ :type _content_type: str, Optional
560
+ :param _headers: set to override the headers for a single
561
+ request; this effectively ignores the headers
562
+ in the spec for a single request.
563
+ :type _headers: dict, optional
564
+ :param _host_index: set to override the host_index for a single
565
+ request; this effectively ignores the host_index
566
+ in the spec for a single request.
567
+ :type _host_index: int, optional
568
+ :return: Returns the result object.
569
+ """ # noqa: E501
570
+
571
+ _param = self._list_serialize(
572
+ pulp_domain=pulp_domain,
573
+ x_task_diagnostics=x_task_diagnostics,
574
+ digest=digest,
575
+ limit=limit,
576
+ offset=offset,
577
+ ordering=ordering,
578
+ orphaned_for=orphaned_for,
579
+ prn__in=prn__in,
580
+ pulp_href__in=pulp_href__in,
581
+ pulp_id__in=pulp_id__in,
582
+ pulp_label_select=pulp_label_select,
583
+ q=q,
584
+ relative_path=relative_path,
585
+ relative_path__contains=relative_path__contains,
586
+ relative_path__icontains=relative_path__icontains,
587
+ relative_path__iexact=relative_path__iexact,
588
+ relative_path__in=relative_path__in,
589
+ relative_path__iregex=relative_path__iregex,
590
+ relative_path__istartswith=relative_path__istartswith,
591
+ relative_path__regex=relative_path__regex,
592
+ relative_path__startswith=relative_path__startswith,
593
+ repository_version=repository_version,
594
+ repository_version_added=repository_version_added,
595
+ repository_version_removed=repository_version_removed,
596
+ sha256=sha256,
597
+ fields=fields,
598
+ exclude_fields=exclude_fields,
599
+ _request_auth=_request_auth,
600
+ _content_type=_content_type,
601
+ _headers=_headers,
602
+ _host_index=_host_index
603
+ )
604
+
605
+ _response_types_map: Dict[str, Optional[str]] = {
606
+ '200': "PaginatedfileFileContentResponseList",
607
+ }
608
+ response_data = self.api_client.call_api(
609
+ *_param,
610
+ _request_timeout=_request_timeout
611
+ )
612
+ response_data.read()
613
+ return self.api_client.response_deserialize(
614
+ response_data=response_data,
615
+ response_types_map=_response_types_map,
616
+ ).data
617
+
618
+
619
+ @validate_call
620
+ def list_with_http_info(
621
+ self,
622
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
623
+ digest: Annotated[Optional[StrictStr], Field(description="Filter results where digest matches value")] = None,
624
+ limit: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
625
+ offset: Annotated[Optional[StrictInt], Field(description="The initial index from which to return the results.")] = None,
626
+ ordering: Annotated[Optional[List[StrictStr]], Field(description="Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `pulp_labels` - Pulp labels * `-pulp_labels` - Pulp labels (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `relative_path` - Relative path * `-relative_path` - Relative path (descending) * `digest` - Digest * `-digest` - Digest (descending) * `pk` - Pk * `-pk` - Pk (descending)")] = None,
627
+ orphaned_for: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.")] = None,
628
+ prn__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
629
+ pulp_href__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
630
+ pulp_id__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
631
+ pulp_label_select: Annotated[Optional[StrictStr], Field(description="Filter labels by search string")] = None,
632
+ q: Annotated[Optional[StrictStr], Field(description="Filter results by using NOT, AND and OR operations on other filters")] = None,
633
+ relative_path: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches value")] = None,
634
+ relative_path__contains: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path contains value")] = None,
635
+ relative_path__icontains: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path contains value")] = None,
636
+ relative_path__iexact: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches value")] = None,
637
+ relative_path__in: Annotated[Optional[List[StrictStr]], Field(description="Filter results where relative_path is in a comma-separated list of values")] = None,
638
+ relative_path__iregex: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches regex value")] = None,
639
+ relative_path__istartswith: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path starts with value")] = None,
640
+ relative_path__regex: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches regex value")] = None,
641
+ relative_path__startswith: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path starts with value")] = None,
642
+ repository_version: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
643
+ repository_version_added: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
644
+ repository_version_removed: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
645
+ sha256: Optional[StrictStr] = None,
646
+ fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to include in the response.")] = None,
647
+ exclude_fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to exclude from the response.")] = None,
648
+ pulp_domain: StrictStr = "default",
649
+ _request_timeout: Union[
650
+ None,
651
+ Annotated[StrictFloat, Field(gt=0)],
652
+ Tuple[
653
+ Annotated[StrictFloat, Field(gt=0)],
654
+ Annotated[StrictFloat, Field(gt=0)]
655
+ ]
656
+ ] = None,
657
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
658
+ _content_type: Optional[StrictStr] = None,
659
+ _headers: Optional[Dict[StrictStr, Any]] = None,
660
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
661
+ ) -> ApiResponse[PaginatedfileFileContentResponseList]:
662
+ """List file contents
663
+
664
+ FileContent represents a single file and its metadata, which can be added and removed from repositories.
665
+
666
+ :param pulp_domain: (required)
667
+ :type pulp_domain: str
668
+ :param x_task_diagnostics: List of profilers to use on tasks.
669
+ :type x_task_diagnostics: List[str]
670
+ :param digest: Filter results where digest matches value
671
+ :type digest: str
672
+ :param limit: Number of results to return per page.
673
+ :type limit: int
674
+ :param offset: The initial index from which to return the results.
675
+ :type offset: int
676
+ :param ordering: Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `pulp_labels` - Pulp labels * `-pulp_labels` - Pulp labels (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `relative_path` - Relative path * `-relative_path` - Relative path (descending) * `digest` - Digest * `-digest` - Digest (descending) * `pk` - Pk * `-pk` - Pk (descending)
677
+ :type ordering: List[str]
678
+ :param orphaned_for: Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.
679
+ :type orphaned_for: float
680
+ :param prn__in: Multiple values may be separated by commas.
681
+ :type prn__in: List[str]
682
+ :param pulp_href__in: Multiple values may be separated by commas.
683
+ :type pulp_href__in: List[str]
684
+ :param pulp_id__in: Multiple values may be separated by commas.
685
+ :type pulp_id__in: List[str]
686
+ :param pulp_label_select: Filter labels by search string
687
+ :type pulp_label_select: str
688
+ :param q: Filter results by using NOT, AND and OR operations on other filters
689
+ :type q: str
690
+ :param relative_path: Filter results where relative_path matches value
691
+ :type relative_path: str
692
+ :param relative_path__contains: Filter results where relative_path contains value
693
+ :type relative_path__contains: str
694
+ :param relative_path__icontains: Filter results where relative_path contains value
695
+ :type relative_path__icontains: str
696
+ :param relative_path__iexact: Filter results where relative_path matches value
697
+ :type relative_path__iexact: str
698
+ :param relative_path__in: Filter results where relative_path is in a comma-separated list of values
699
+ :type relative_path__in: List[str]
700
+ :param relative_path__iregex: Filter results where relative_path matches regex value
701
+ :type relative_path__iregex: str
702
+ :param relative_path__istartswith: Filter results where relative_path starts with value
703
+ :type relative_path__istartswith: str
704
+ :param relative_path__regex: Filter results where relative_path matches regex value
705
+ :type relative_path__regex: str
706
+ :param relative_path__startswith: Filter results where relative_path starts with value
707
+ :type relative_path__startswith: str
708
+ :param repository_version: Repository Version referenced by HREF/PRN
709
+ :type repository_version: str
710
+ :param repository_version_added: Repository Version referenced by HREF/PRN
711
+ :type repository_version_added: str
712
+ :param repository_version_removed: Repository Version referenced by HREF/PRN
713
+ :type repository_version_removed: str
714
+ :param sha256:
715
+ :type sha256: str
716
+ :param fields: A list of fields to include in the response.
717
+ :type fields: List[str]
718
+ :param exclude_fields: A list of fields to exclude from the response.
719
+ :type exclude_fields: List[str]
720
+ :param _request_timeout: timeout setting for this request. If one
721
+ number provided, it will be total request
722
+ timeout. It can also be a pair (tuple) of
723
+ (connection, read) timeouts.
724
+ :type _request_timeout: int, tuple(int, int), optional
725
+ :param _request_auth: set to override the auth_settings for an a single
726
+ request; this effectively ignores the
727
+ authentication in the spec for a single request.
728
+ :type _request_auth: dict, optional
729
+ :param _content_type: force content-type for the request.
730
+ :type _content_type: str, Optional
731
+ :param _headers: set to override the headers for a single
732
+ request; this effectively ignores the headers
733
+ in the spec for a single request.
734
+ :type _headers: dict, optional
735
+ :param _host_index: set to override the host_index for a single
736
+ request; this effectively ignores the host_index
737
+ in the spec for a single request.
738
+ :type _host_index: int, optional
739
+ :return: Returns the result object.
740
+ """ # noqa: E501
741
+
742
+ _param = self._list_serialize(
743
+ pulp_domain=pulp_domain,
744
+ x_task_diagnostics=x_task_diagnostics,
745
+ digest=digest,
746
+ limit=limit,
747
+ offset=offset,
748
+ ordering=ordering,
749
+ orphaned_for=orphaned_for,
750
+ prn__in=prn__in,
751
+ pulp_href__in=pulp_href__in,
752
+ pulp_id__in=pulp_id__in,
753
+ pulp_label_select=pulp_label_select,
754
+ q=q,
755
+ relative_path=relative_path,
756
+ relative_path__contains=relative_path__contains,
757
+ relative_path__icontains=relative_path__icontains,
758
+ relative_path__iexact=relative_path__iexact,
759
+ relative_path__in=relative_path__in,
760
+ relative_path__iregex=relative_path__iregex,
761
+ relative_path__istartswith=relative_path__istartswith,
762
+ relative_path__regex=relative_path__regex,
763
+ relative_path__startswith=relative_path__startswith,
764
+ repository_version=repository_version,
765
+ repository_version_added=repository_version_added,
766
+ repository_version_removed=repository_version_removed,
767
+ sha256=sha256,
768
+ fields=fields,
769
+ exclude_fields=exclude_fields,
770
+ _request_auth=_request_auth,
771
+ _content_type=_content_type,
772
+ _headers=_headers,
773
+ _host_index=_host_index
774
+ )
775
+
776
+ _response_types_map: Dict[str, Optional[str]] = {
777
+ '200': "PaginatedfileFileContentResponseList",
778
+ }
779
+ response_data = self.api_client.call_api(
780
+ *_param,
781
+ _request_timeout=_request_timeout
782
+ )
783
+ response_data.read()
784
+ return self.api_client.response_deserialize(
785
+ response_data=response_data,
786
+ response_types_map=_response_types_map,
787
+ )
788
+
789
+
790
+ @validate_call
791
+ def list_without_preload_content(
792
+ self,
793
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
794
+ digest: Annotated[Optional[StrictStr], Field(description="Filter results where digest matches value")] = None,
795
+ limit: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
796
+ offset: Annotated[Optional[StrictInt], Field(description="The initial index from which to return the results.")] = None,
797
+ ordering: Annotated[Optional[List[StrictStr]], Field(description="Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `pulp_labels` - Pulp labels * `-pulp_labels` - Pulp labels (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `relative_path` - Relative path * `-relative_path` - Relative path (descending) * `digest` - Digest * `-digest` - Digest (descending) * `pk` - Pk * `-pk` - Pk (descending)")] = None,
798
+ orphaned_for: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.")] = None,
799
+ prn__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
800
+ pulp_href__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
801
+ pulp_id__in: Annotated[Optional[List[StrictStr]], Field(description="Multiple values may be separated by commas.")] = None,
802
+ pulp_label_select: Annotated[Optional[StrictStr], Field(description="Filter labels by search string")] = None,
803
+ q: Annotated[Optional[StrictStr], Field(description="Filter results by using NOT, AND and OR operations on other filters")] = None,
804
+ relative_path: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches value")] = None,
805
+ relative_path__contains: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path contains value")] = None,
806
+ relative_path__icontains: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path contains value")] = None,
807
+ relative_path__iexact: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches value")] = None,
808
+ relative_path__in: Annotated[Optional[List[StrictStr]], Field(description="Filter results where relative_path is in a comma-separated list of values")] = None,
809
+ relative_path__iregex: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches regex value")] = None,
810
+ relative_path__istartswith: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path starts with value")] = None,
811
+ relative_path__regex: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path matches regex value")] = None,
812
+ relative_path__startswith: Annotated[Optional[StrictStr], Field(description="Filter results where relative_path starts with value")] = None,
813
+ repository_version: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
814
+ repository_version_added: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
815
+ repository_version_removed: Annotated[Optional[StrictStr], Field(description="Repository Version referenced by HREF/PRN")] = None,
816
+ sha256: Optional[StrictStr] = None,
817
+ fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to include in the response.")] = None,
818
+ exclude_fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to exclude from the response.")] = None,
819
+ pulp_domain: StrictStr = "default",
820
+ _request_timeout: Union[
821
+ None,
822
+ Annotated[StrictFloat, Field(gt=0)],
823
+ Tuple[
824
+ Annotated[StrictFloat, Field(gt=0)],
825
+ Annotated[StrictFloat, Field(gt=0)]
826
+ ]
827
+ ] = None,
828
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
829
+ _content_type: Optional[StrictStr] = None,
830
+ _headers: Optional[Dict[StrictStr, Any]] = None,
831
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
832
+ ) -> RESTResponseType:
833
+ """List file contents
834
+
835
+ FileContent represents a single file and its metadata, which can be added and removed from repositories.
836
+
837
+ :param pulp_domain: (required)
838
+ :type pulp_domain: str
839
+ :param x_task_diagnostics: List of profilers to use on tasks.
840
+ :type x_task_diagnostics: List[str]
841
+ :param digest: Filter results where digest matches value
842
+ :type digest: str
843
+ :param limit: Number of results to return per page.
844
+ :type limit: int
845
+ :param offset: The initial index from which to return the results.
846
+ :type offset: int
847
+ :param ordering: Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `pulp_labels` - Pulp labels * `-pulp_labels` - Pulp labels (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `relative_path` - Relative path * `-relative_path` - Relative path (descending) * `digest` - Digest * `-digest` - Digest (descending) * `pk` - Pk * `-pk` - Pk (descending)
848
+ :type ordering: List[str]
849
+ :param orphaned_for: Minutes Content has been orphaned for. -1 uses ORPHAN_PROTECTION_TIME.
850
+ :type orphaned_for: float
851
+ :param prn__in: Multiple values may be separated by commas.
852
+ :type prn__in: List[str]
853
+ :param pulp_href__in: Multiple values may be separated by commas.
854
+ :type pulp_href__in: List[str]
855
+ :param pulp_id__in: Multiple values may be separated by commas.
856
+ :type pulp_id__in: List[str]
857
+ :param pulp_label_select: Filter labels by search string
858
+ :type pulp_label_select: str
859
+ :param q: Filter results by using NOT, AND and OR operations on other filters
860
+ :type q: str
861
+ :param relative_path: Filter results where relative_path matches value
862
+ :type relative_path: str
863
+ :param relative_path__contains: Filter results where relative_path contains value
864
+ :type relative_path__contains: str
865
+ :param relative_path__icontains: Filter results where relative_path contains value
866
+ :type relative_path__icontains: str
867
+ :param relative_path__iexact: Filter results where relative_path matches value
868
+ :type relative_path__iexact: str
869
+ :param relative_path__in: Filter results where relative_path is in a comma-separated list of values
870
+ :type relative_path__in: List[str]
871
+ :param relative_path__iregex: Filter results where relative_path matches regex value
872
+ :type relative_path__iregex: str
873
+ :param relative_path__istartswith: Filter results where relative_path starts with value
874
+ :type relative_path__istartswith: str
875
+ :param relative_path__regex: Filter results where relative_path matches regex value
876
+ :type relative_path__regex: str
877
+ :param relative_path__startswith: Filter results where relative_path starts with value
878
+ :type relative_path__startswith: str
879
+ :param repository_version: Repository Version referenced by HREF/PRN
880
+ :type repository_version: str
881
+ :param repository_version_added: Repository Version referenced by HREF/PRN
882
+ :type repository_version_added: str
883
+ :param repository_version_removed: Repository Version referenced by HREF/PRN
884
+ :type repository_version_removed: str
885
+ :param sha256:
886
+ :type sha256: str
887
+ :param fields: A list of fields to include in the response.
888
+ :type fields: List[str]
889
+ :param exclude_fields: A list of fields to exclude from the response.
890
+ :type exclude_fields: List[str]
891
+ :param _request_timeout: timeout setting for this request. If one
892
+ number provided, it will be total request
893
+ timeout. It can also be a pair (tuple) of
894
+ (connection, read) timeouts.
895
+ :type _request_timeout: int, tuple(int, int), optional
896
+ :param _request_auth: set to override the auth_settings for an a single
897
+ request; this effectively ignores the
898
+ authentication in the spec for a single request.
899
+ :type _request_auth: dict, optional
900
+ :param _content_type: force content-type for the request.
901
+ :type _content_type: str, Optional
902
+ :param _headers: set to override the headers for a single
903
+ request; this effectively ignores the headers
904
+ in the spec for a single request.
905
+ :type _headers: dict, optional
906
+ :param _host_index: set to override the host_index for a single
907
+ request; this effectively ignores the host_index
908
+ in the spec for a single request.
909
+ :type _host_index: int, optional
910
+ :return: Returns the result object.
911
+ """ # noqa: E501
912
+
913
+ _param = self._list_serialize(
914
+ pulp_domain=pulp_domain,
915
+ x_task_diagnostics=x_task_diagnostics,
916
+ digest=digest,
917
+ limit=limit,
918
+ offset=offset,
919
+ ordering=ordering,
920
+ orphaned_for=orphaned_for,
921
+ prn__in=prn__in,
922
+ pulp_href__in=pulp_href__in,
923
+ pulp_id__in=pulp_id__in,
924
+ pulp_label_select=pulp_label_select,
925
+ q=q,
926
+ relative_path=relative_path,
927
+ relative_path__contains=relative_path__contains,
928
+ relative_path__icontains=relative_path__icontains,
929
+ relative_path__iexact=relative_path__iexact,
930
+ relative_path__in=relative_path__in,
931
+ relative_path__iregex=relative_path__iregex,
932
+ relative_path__istartswith=relative_path__istartswith,
933
+ relative_path__regex=relative_path__regex,
934
+ relative_path__startswith=relative_path__startswith,
935
+ repository_version=repository_version,
936
+ repository_version_added=repository_version_added,
937
+ repository_version_removed=repository_version_removed,
938
+ sha256=sha256,
939
+ fields=fields,
940
+ exclude_fields=exclude_fields,
941
+ _request_auth=_request_auth,
942
+ _content_type=_content_type,
943
+ _headers=_headers,
944
+ _host_index=_host_index
945
+ )
946
+
947
+ _response_types_map: Dict[str, Optional[str]] = {
948
+ '200': "PaginatedfileFileContentResponseList",
949
+ }
950
+ response_data = self.api_client.call_api(
951
+ *_param,
952
+ _request_timeout=_request_timeout
953
+ )
954
+ return response_data.response
955
+
956
+
957
+ def _list_serialize(
958
+ self,
959
+ pulp_domain,
960
+ x_task_diagnostics,
961
+ digest,
962
+ limit,
963
+ offset,
964
+ ordering,
965
+ orphaned_for,
966
+ prn__in,
967
+ pulp_href__in,
968
+ pulp_id__in,
969
+ pulp_label_select,
970
+ q,
971
+ relative_path,
972
+ relative_path__contains,
973
+ relative_path__icontains,
974
+ relative_path__iexact,
975
+ relative_path__in,
976
+ relative_path__iregex,
977
+ relative_path__istartswith,
978
+ relative_path__regex,
979
+ relative_path__startswith,
980
+ repository_version,
981
+ repository_version_added,
982
+ repository_version_removed,
983
+ sha256,
984
+ fields,
985
+ exclude_fields,
986
+ _request_auth,
987
+ _content_type,
988
+ _headers,
989
+ _host_index,
990
+ ) -> RequestSerialized:
991
+
992
+ _host = None
993
+
994
+ _collection_formats: Dict[str, str] = {
995
+ 'X-Task-Diagnostics': 'csv',
996
+ 'ordering': 'csv',
997
+ 'prn__in': 'csv',
998
+ 'pulp_href__in': 'csv',
999
+ 'pulp_id__in': 'csv',
1000
+ 'relative_path__in': 'csv',
1001
+ 'fields': 'multi',
1002
+ 'exclude_fields': 'multi',
1003
+ }
1004
+
1005
+ _path_params: Dict[str, str] = {}
1006
+ _query_params: List[Tuple[str, str]] = []
1007
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1008
+ _form_params: List[Tuple[str, str]] = []
1009
+ _files: Dict[
1010
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1011
+ ] = {}
1012
+ _body_params: Optional[bytes] = None
1013
+
1014
+ # process the path parameters
1015
+ if pulp_domain is not None:
1016
+ _path_params['pulp_domain'] = pulp_domain
1017
+ # process the query parameters
1018
+ if digest is not None:
1019
+
1020
+ _query_params.append(('digest', digest))
1021
+
1022
+ if limit is not None:
1023
+
1024
+ _query_params.append(('limit', limit))
1025
+
1026
+ if offset is not None:
1027
+
1028
+ _query_params.append(('offset', offset))
1029
+
1030
+ if ordering is not None:
1031
+
1032
+ _query_params.append(('ordering', ordering))
1033
+
1034
+ if orphaned_for is not None:
1035
+
1036
+ _query_params.append(('orphaned_for', orphaned_for))
1037
+
1038
+ if prn__in is not None:
1039
+
1040
+ _query_params.append(('prn__in', prn__in))
1041
+
1042
+ if pulp_href__in is not None:
1043
+
1044
+ _query_params.append(('pulp_href__in', pulp_href__in))
1045
+
1046
+ if pulp_id__in is not None:
1047
+
1048
+ _query_params.append(('pulp_id__in', pulp_id__in))
1049
+
1050
+ if pulp_label_select is not None:
1051
+
1052
+ _query_params.append(('pulp_label_select', pulp_label_select))
1053
+
1054
+ if q is not None:
1055
+
1056
+ _query_params.append(('q', q))
1057
+
1058
+ if relative_path is not None:
1059
+
1060
+ _query_params.append(('relative_path', relative_path))
1061
+
1062
+ if relative_path__contains is not None:
1063
+
1064
+ _query_params.append(('relative_path__contains', relative_path__contains))
1065
+
1066
+ if relative_path__icontains is not None:
1067
+
1068
+ _query_params.append(('relative_path__icontains', relative_path__icontains))
1069
+
1070
+ if relative_path__iexact is not None:
1071
+
1072
+ _query_params.append(('relative_path__iexact', relative_path__iexact))
1073
+
1074
+ if relative_path__in is not None:
1075
+
1076
+ _query_params.append(('relative_path__in', relative_path__in))
1077
+
1078
+ if relative_path__iregex is not None:
1079
+
1080
+ _query_params.append(('relative_path__iregex', relative_path__iregex))
1081
+
1082
+ if relative_path__istartswith is not None:
1083
+
1084
+ _query_params.append(('relative_path__istartswith', relative_path__istartswith))
1085
+
1086
+ if relative_path__regex is not None:
1087
+
1088
+ _query_params.append(('relative_path__regex', relative_path__regex))
1089
+
1090
+ if relative_path__startswith is not None:
1091
+
1092
+ _query_params.append(('relative_path__startswith', relative_path__startswith))
1093
+
1094
+ if repository_version is not None:
1095
+
1096
+ _query_params.append(('repository_version', repository_version))
1097
+
1098
+ if repository_version_added is not None:
1099
+
1100
+ _query_params.append(('repository_version_added', repository_version_added))
1101
+
1102
+ if repository_version_removed is not None:
1103
+
1104
+ _query_params.append(('repository_version_removed', repository_version_removed))
1105
+
1106
+ if sha256 is not None:
1107
+
1108
+ _query_params.append(('sha256', sha256))
1109
+
1110
+ if fields is not None:
1111
+
1112
+ _query_params.append(('fields', fields))
1113
+
1114
+ if exclude_fields is not None:
1115
+
1116
+ _query_params.append(('exclude_fields', exclude_fields))
1117
+
1118
+ # process the header parameters
1119
+ if x_task_diagnostics is not None:
1120
+ _header_params['X-Task-Diagnostics'] = x_task_diagnostics
1121
+ # process the form parameters
1122
+ # process the body parameter
1123
+
1124
+
1125
+ # set the HTTP header `Accept`
1126
+ if 'Accept' not in _header_params:
1127
+ _header_params['Accept'] = self.api_client.select_header_accept(
1128
+ [
1129
+ 'application/json'
1130
+ ]
1131
+ )
1132
+
1133
+
1134
+ # authentication setting
1135
+ _auth_settings: List[str] = [
1136
+ 'json_header_remote_authentication',
1137
+ 'basicAuth',
1138
+ 'cookieAuth'
1139
+ ]
1140
+
1141
+ return self.api_client.param_serialize(
1142
+ method='GET',
1143
+ resource_path='/api/pulp/{pulp_domain}/api/v3/content/file/files/',
1144
+ path_params=_path_params,
1145
+ query_params=_query_params,
1146
+ header_params=_header_params,
1147
+ body=_body_params,
1148
+ post_params=_form_params,
1149
+ files=_files,
1150
+ auth_settings=_auth_settings,
1151
+ collection_formats=_collection_formats,
1152
+ _host=_host,
1153
+ _request_auth=_request_auth
1154
+ )
1155
+
1156
+
1157
+
1158
+
1159
+ @validate_call
1160
+ def read(
1161
+ self,
1162
+ file_file_content_href: StrictStr,
1163
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1164
+ fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to include in the response.")] = None,
1165
+ exclude_fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to exclude from the response.")] = None,
1166
+ _request_timeout: Union[
1167
+ None,
1168
+ Annotated[StrictFloat, Field(gt=0)],
1169
+ Tuple[
1170
+ Annotated[StrictFloat, Field(gt=0)],
1171
+ Annotated[StrictFloat, Field(gt=0)]
1172
+ ]
1173
+ ] = None,
1174
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1175
+ _content_type: Optional[StrictStr] = None,
1176
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1177
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1178
+ ) -> FileFileContentResponse:
1179
+ """Inspect a file content
1180
+
1181
+ FileContent represents a single file and its metadata, which can be added and removed from repositories.
1182
+
1183
+ :param file_file_content_href: (required)
1184
+ :type file_file_content_href: str
1185
+ :param x_task_diagnostics: List of profilers to use on tasks.
1186
+ :type x_task_diagnostics: List[str]
1187
+ :param fields: A list of fields to include in the response.
1188
+ :type fields: List[str]
1189
+ :param exclude_fields: A list of fields to exclude from the response.
1190
+ :type exclude_fields: List[str]
1191
+ :param _request_timeout: timeout setting for this request. If one
1192
+ number provided, it will be total request
1193
+ timeout. It can also be a pair (tuple) of
1194
+ (connection, read) timeouts.
1195
+ :type _request_timeout: int, tuple(int, int), optional
1196
+ :param _request_auth: set to override the auth_settings for an a single
1197
+ request; this effectively ignores the
1198
+ authentication in the spec for a single request.
1199
+ :type _request_auth: dict, optional
1200
+ :param _content_type: force content-type for the request.
1201
+ :type _content_type: str, Optional
1202
+ :param _headers: set to override the headers for a single
1203
+ request; this effectively ignores the headers
1204
+ in the spec for a single request.
1205
+ :type _headers: dict, optional
1206
+ :param _host_index: set to override the host_index for a single
1207
+ request; this effectively ignores the host_index
1208
+ in the spec for a single request.
1209
+ :type _host_index: int, optional
1210
+ :return: Returns the result object.
1211
+ """ # noqa: E501
1212
+
1213
+ _param = self._read_serialize(
1214
+ file_file_content_href=file_file_content_href,
1215
+ x_task_diagnostics=x_task_diagnostics,
1216
+ fields=fields,
1217
+ exclude_fields=exclude_fields,
1218
+ _request_auth=_request_auth,
1219
+ _content_type=_content_type,
1220
+ _headers=_headers,
1221
+ _host_index=_host_index
1222
+ )
1223
+
1224
+ _response_types_map: Dict[str, Optional[str]] = {
1225
+ '200': "FileFileContentResponse",
1226
+ }
1227
+ response_data = self.api_client.call_api(
1228
+ *_param,
1229
+ _request_timeout=_request_timeout
1230
+ )
1231
+ response_data.read()
1232
+ return self.api_client.response_deserialize(
1233
+ response_data=response_data,
1234
+ response_types_map=_response_types_map,
1235
+ ).data
1236
+
1237
+
1238
+ @validate_call
1239
+ def read_with_http_info(
1240
+ self,
1241
+ file_file_content_href: StrictStr,
1242
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1243
+ fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to include in the response.")] = None,
1244
+ exclude_fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to exclude from the response.")] = None,
1245
+ _request_timeout: Union[
1246
+ None,
1247
+ Annotated[StrictFloat, Field(gt=0)],
1248
+ Tuple[
1249
+ Annotated[StrictFloat, Field(gt=0)],
1250
+ Annotated[StrictFloat, Field(gt=0)]
1251
+ ]
1252
+ ] = None,
1253
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1254
+ _content_type: Optional[StrictStr] = None,
1255
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1256
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1257
+ ) -> ApiResponse[FileFileContentResponse]:
1258
+ """Inspect a file content
1259
+
1260
+ FileContent represents a single file and its metadata, which can be added and removed from repositories.
1261
+
1262
+ :param file_file_content_href: (required)
1263
+ :type file_file_content_href: str
1264
+ :param x_task_diagnostics: List of profilers to use on tasks.
1265
+ :type x_task_diagnostics: List[str]
1266
+ :param fields: A list of fields to include in the response.
1267
+ :type fields: List[str]
1268
+ :param exclude_fields: A list of fields to exclude from the response.
1269
+ :type exclude_fields: List[str]
1270
+ :param _request_timeout: timeout setting for this request. If one
1271
+ number provided, it will be total request
1272
+ timeout. It can also be a pair (tuple) of
1273
+ (connection, read) timeouts.
1274
+ :type _request_timeout: int, tuple(int, int), optional
1275
+ :param _request_auth: set to override the auth_settings for an a single
1276
+ request; this effectively ignores the
1277
+ authentication in the spec for a single request.
1278
+ :type _request_auth: dict, optional
1279
+ :param _content_type: force content-type for the request.
1280
+ :type _content_type: str, Optional
1281
+ :param _headers: set to override the headers for a single
1282
+ request; this effectively ignores the headers
1283
+ in the spec for a single request.
1284
+ :type _headers: dict, optional
1285
+ :param _host_index: set to override the host_index for a single
1286
+ request; this effectively ignores the host_index
1287
+ in the spec for a single request.
1288
+ :type _host_index: int, optional
1289
+ :return: Returns the result object.
1290
+ """ # noqa: E501
1291
+
1292
+ _param = self._read_serialize(
1293
+ file_file_content_href=file_file_content_href,
1294
+ x_task_diagnostics=x_task_diagnostics,
1295
+ fields=fields,
1296
+ exclude_fields=exclude_fields,
1297
+ _request_auth=_request_auth,
1298
+ _content_type=_content_type,
1299
+ _headers=_headers,
1300
+ _host_index=_host_index
1301
+ )
1302
+
1303
+ _response_types_map: Dict[str, Optional[str]] = {
1304
+ '200': "FileFileContentResponse",
1305
+ }
1306
+ response_data = self.api_client.call_api(
1307
+ *_param,
1308
+ _request_timeout=_request_timeout
1309
+ )
1310
+ response_data.read()
1311
+ return self.api_client.response_deserialize(
1312
+ response_data=response_data,
1313
+ response_types_map=_response_types_map,
1314
+ )
1315
+
1316
+
1317
+ @validate_call
1318
+ def read_without_preload_content(
1319
+ self,
1320
+ file_file_content_href: StrictStr,
1321
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1322
+ fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to include in the response.")] = None,
1323
+ exclude_fields: Annotated[Optional[List[StrictStr]], Field(description="A list of fields to exclude from the response.")] = None,
1324
+ _request_timeout: Union[
1325
+ None,
1326
+ Annotated[StrictFloat, Field(gt=0)],
1327
+ Tuple[
1328
+ Annotated[StrictFloat, Field(gt=0)],
1329
+ Annotated[StrictFloat, Field(gt=0)]
1330
+ ]
1331
+ ] = None,
1332
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1333
+ _content_type: Optional[StrictStr] = None,
1334
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1335
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1336
+ ) -> RESTResponseType:
1337
+ """Inspect a file content
1338
+
1339
+ FileContent represents a single file and its metadata, which can be added and removed from repositories.
1340
+
1341
+ :param file_file_content_href: (required)
1342
+ :type file_file_content_href: str
1343
+ :param x_task_diagnostics: List of profilers to use on tasks.
1344
+ :type x_task_diagnostics: List[str]
1345
+ :param fields: A list of fields to include in the response.
1346
+ :type fields: List[str]
1347
+ :param exclude_fields: A list of fields to exclude from the response.
1348
+ :type exclude_fields: List[str]
1349
+ :param _request_timeout: timeout setting for this request. If one
1350
+ number provided, it will be total request
1351
+ timeout. It can also be a pair (tuple) of
1352
+ (connection, read) timeouts.
1353
+ :type _request_timeout: int, tuple(int, int), optional
1354
+ :param _request_auth: set to override the auth_settings for an a single
1355
+ request; this effectively ignores the
1356
+ authentication in the spec for a single request.
1357
+ :type _request_auth: dict, optional
1358
+ :param _content_type: force content-type for the request.
1359
+ :type _content_type: str, Optional
1360
+ :param _headers: set to override the headers for a single
1361
+ request; this effectively ignores the headers
1362
+ in the spec for a single request.
1363
+ :type _headers: dict, optional
1364
+ :param _host_index: set to override the host_index for a single
1365
+ request; this effectively ignores the host_index
1366
+ in the spec for a single request.
1367
+ :type _host_index: int, optional
1368
+ :return: Returns the result object.
1369
+ """ # noqa: E501
1370
+
1371
+ _param = self._read_serialize(
1372
+ file_file_content_href=file_file_content_href,
1373
+ x_task_diagnostics=x_task_diagnostics,
1374
+ fields=fields,
1375
+ exclude_fields=exclude_fields,
1376
+ _request_auth=_request_auth,
1377
+ _content_type=_content_type,
1378
+ _headers=_headers,
1379
+ _host_index=_host_index
1380
+ )
1381
+
1382
+ _response_types_map: Dict[str, Optional[str]] = {
1383
+ '200': "FileFileContentResponse",
1384
+ }
1385
+ response_data = self.api_client.call_api(
1386
+ *_param,
1387
+ _request_timeout=_request_timeout
1388
+ )
1389
+ return response_data.response
1390
+
1391
+
1392
+ def _read_serialize(
1393
+ self,
1394
+ file_file_content_href,
1395
+ x_task_diagnostics,
1396
+ fields,
1397
+ exclude_fields,
1398
+ _request_auth,
1399
+ _content_type,
1400
+ _headers,
1401
+ _host_index,
1402
+ ) -> RequestSerialized:
1403
+
1404
+ _host = None
1405
+
1406
+ _collection_formats: Dict[str, str] = {
1407
+ 'X-Task-Diagnostics': 'csv',
1408
+ 'fields': 'multi',
1409
+ 'exclude_fields': 'multi',
1410
+ }
1411
+
1412
+ _path_params: Dict[str, str] = {}
1413
+ _query_params: List[Tuple[str, str]] = []
1414
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1415
+ _form_params: List[Tuple[str, str]] = []
1416
+ _files: Dict[
1417
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1418
+ ] = {}
1419
+ _body_params: Optional[bytes] = None
1420
+
1421
+ # process the path parameters
1422
+ if file_file_content_href is not None:
1423
+ _path_params['file_file_content_href'] = file_file_content_href
1424
+ # process the query parameters
1425
+ if fields is not None:
1426
+
1427
+ _query_params.append(('fields', fields))
1428
+
1429
+ if exclude_fields is not None:
1430
+
1431
+ _query_params.append(('exclude_fields', exclude_fields))
1432
+
1433
+ # process the header parameters
1434
+ if x_task_diagnostics is not None:
1435
+ _header_params['X-Task-Diagnostics'] = x_task_diagnostics
1436
+ # process the form parameters
1437
+ # process the body parameter
1438
+
1439
+
1440
+ # set the HTTP header `Accept`
1441
+ if 'Accept' not in _header_params:
1442
+ _header_params['Accept'] = self.api_client.select_header_accept(
1443
+ [
1444
+ 'application/json'
1445
+ ]
1446
+ )
1447
+
1448
+
1449
+ # authentication setting
1450
+ _auth_settings: List[str] = [
1451
+ 'json_header_remote_authentication',
1452
+ 'basicAuth',
1453
+ 'cookieAuth'
1454
+ ]
1455
+
1456
+ return self.api_client.param_serialize(
1457
+ method='GET',
1458
+ resource_path='{file_file_content_href}',
1459
+ path_params=_path_params,
1460
+ query_params=_query_params,
1461
+ header_params=_header_params,
1462
+ body=_body_params,
1463
+ post_params=_form_params,
1464
+ files=_files,
1465
+ auth_settings=_auth_settings,
1466
+ collection_formats=_collection_formats,
1467
+ _host=_host,
1468
+ _request_auth=_request_auth
1469
+ )
1470
+
1471
+
1472
+
1473
+
1474
+ @validate_call
1475
+ def set_label(
1476
+ self,
1477
+ file_file_content_href: StrictStr,
1478
+ set_label: SetLabel,
1479
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1480
+ _request_timeout: Union[
1481
+ None,
1482
+ Annotated[StrictFloat, Field(gt=0)],
1483
+ Tuple[
1484
+ Annotated[StrictFloat, Field(gt=0)],
1485
+ Annotated[StrictFloat, Field(gt=0)]
1486
+ ]
1487
+ ] = None,
1488
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1489
+ _content_type: Optional[StrictStr] = None,
1490
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1491
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1492
+ ) -> SetLabelResponse:
1493
+ """Set a label
1494
+
1495
+ Set a single pulp_label on the object to a specific value or null.
1496
+
1497
+ :param file_file_content_href: (required)
1498
+ :type file_file_content_href: str
1499
+ :param set_label: (required)
1500
+ :type set_label: SetLabel
1501
+ :param x_task_diagnostics: List of profilers to use on tasks.
1502
+ :type x_task_diagnostics: List[str]
1503
+ :param _request_timeout: timeout setting for this request. If one
1504
+ number provided, it will be total request
1505
+ timeout. It can also be a pair (tuple) of
1506
+ (connection, read) timeouts.
1507
+ :type _request_timeout: int, tuple(int, int), optional
1508
+ :param _request_auth: set to override the auth_settings for an a single
1509
+ request; this effectively ignores the
1510
+ authentication in the spec for a single request.
1511
+ :type _request_auth: dict, optional
1512
+ :param _content_type: force content-type for the request.
1513
+ :type _content_type: str, Optional
1514
+ :param _headers: set to override the headers for a single
1515
+ request; this effectively ignores the headers
1516
+ in the spec for a single request.
1517
+ :type _headers: dict, optional
1518
+ :param _host_index: set to override the host_index for a single
1519
+ request; this effectively ignores the host_index
1520
+ in the spec for a single request.
1521
+ :type _host_index: int, optional
1522
+ :return: Returns the result object.
1523
+ """ # noqa: E501
1524
+
1525
+ _param = self._set_label_serialize(
1526
+ file_file_content_href=file_file_content_href,
1527
+ set_label=set_label,
1528
+ x_task_diagnostics=x_task_diagnostics,
1529
+ _request_auth=_request_auth,
1530
+ _content_type=_content_type,
1531
+ _headers=_headers,
1532
+ _host_index=_host_index
1533
+ )
1534
+
1535
+ _response_types_map: Dict[str, Optional[str]] = {
1536
+ '201': "SetLabelResponse",
1537
+ }
1538
+ response_data = self.api_client.call_api(
1539
+ *_param,
1540
+ _request_timeout=_request_timeout
1541
+ )
1542
+ response_data.read()
1543
+ return self.api_client.response_deserialize(
1544
+ response_data=response_data,
1545
+ response_types_map=_response_types_map,
1546
+ ).data
1547
+
1548
+
1549
+ @validate_call
1550
+ def set_label_with_http_info(
1551
+ self,
1552
+ file_file_content_href: StrictStr,
1553
+ set_label: SetLabel,
1554
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1555
+ _request_timeout: Union[
1556
+ None,
1557
+ Annotated[StrictFloat, Field(gt=0)],
1558
+ Tuple[
1559
+ Annotated[StrictFloat, Field(gt=0)],
1560
+ Annotated[StrictFloat, Field(gt=0)]
1561
+ ]
1562
+ ] = None,
1563
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1564
+ _content_type: Optional[StrictStr] = None,
1565
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1566
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1567
+ ) -> ApiResponse[SetLabelResponse]:
1568
+ """Set a label
1569
+
1570
+ Set a single pulp_label on the object to a specific value or null.
1571
+
1572
+ :param file_file_content_href: (required)
1573
+ :type file_file_content_href: str
1574
+ :param set_label: (required)
1575
+ :type set_label: SetLabel
1576
+ :param x_task_diagnostics: List of profilers to use on tasks.
1577
+ :type x_task_diagnostics: List[str]
1578
+ :param _request_timeout: timeout setting for this request. If one
1579
+ number provided, it will be total request
1580
+ timeout. It can also be a pair (tuple) of
1581
+ (connection, read) timeouts.
1582
+ :type _request_timeout: int, tuple(int, int), optional
1583
+ :param _request_auth: set to override the auth_settings for an a single
1584
+ request; this effectively ignores the
1585
+ authentication in the spec for a single request.
1586
+ :type _request_auth: dict, optional
1587
+ :param _content_type: force content-type for the request.
1588
+ :type _content_type: str, Optional
1589
+ :param _headers: set to override the headers for a single
1590
+ request; this effectively ignores the headers
1591
+ in the spec for a single request.
1592
+ :type _headers: dict, optional
1593
+ :param _host_index: set to override the host_index for a single
1594
+ request; this effectively ignores the host_index
1595
+ in the spec for a single request.
1596
+ :type _host_index: int, optional
1597
+ :return: Returns the result object.
1598
+ """ # noqa: E501
1599
+
1600
+ _param = self._set_label_serialize(
1601
+ file_file_content_href=file_file_content_href,
1602
+ set_label=set_label,
1603
+ x_task_diagnostics=x_task_diagnostics,
1604
+ _request_auth=_request_auth,
1605
+ _content_type=_content_type,
1606
+ _headers=_headers,
1607
+ _host_index=_host_index
1608
+ )
1609
+
1610
+ _response_types_map: Dict[str, Optional[str]] = {
1611
+ '201': "SetLabelResponse",
1612
+ }
1613
+ response_data = self.api_client.call_api(
1614
+ *_param,
1615
+ _request_timeout=_request_timeout
1616
+ )
1617
+ response_data.read()
1618
+ return self.api_client.response_deserialize(
1619
+ response_data=response_data,
1620
+ response_types_map=_response_types_map,
1621
+ )
1622
+
1623
+
1624
+ @validate_call
1625
+ def set_label_without_preload_content(
1626
+ self,
1627
+ file_file_content_href: StrictStr,
1628
+ set_label: SetLabel,
1629
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1630
+ _request_timeout: Union[
1631
+ None,
1632
+ Annotated[StrictFloat, Field(gt=0)],
1633
+ Tuple[
1634
+ Annotated[StrictFloat, Field(gt=0)],
1635
+ Annotated[StrictFloat, Field(gt=0)]
1636
+ ]
1637
+ ] = None,
1638
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1639
+ _content_type: Optional[StrictStr] = None,
1640
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1641
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1642
+ ) -> RESTResponseType:
1643
+ """Set a label
1644
+
1645
+ Set a single pulp_label on the object to a specific value or null.
1646
+
1647
+ :param file_file_content_href: (required)
1648
+ :type file_file_content_href: str
1649
+ :param set_label: (required)
1650
+ :type set_label: SetLabel
1651
+ :param x_task_diagnostics: List of profilers to use on tasks.
1652
+ :type x_task_diagnostics: List[str]
1653
+ :param _request_timeout: timeout setting for this request. If one
1654
+ number provided, it will be total request
1655
+ timeout. It can also be a pair (tuple) of
1656
+ (connection, read) timeouts.
1657
+ :type _request_timeout: int, tuple(int, int), optional
1658
+ :param _request_auth: set to override the auth_settings for an a single
1659
+ request; this effectively ignores the
1660
+ authentication in the spec for a single request.
1661
+ :type _request_auth: dict, optional
1662
+ :param _content_type: force content-type for the request.
1663
+ :type _content_type: str, Optional
1664
+ :param _headers: set to override the headers for a single
1665
+ request; this effectively ignores the headers
1666
+ in the spec for a single request.
1667
+ :type _headers: dict, optional
1668
+ :param _host_index: set to override the host_index for a single
1669
+ request; this effectively ignores the host_index
1670
+ in the spec for a single request.
1671
+ :type _host_index: int, optional
1672
+ :return: Returns the result object.
1673
+ """ # noqa: E501
1674
+
1675
+ _param = self._set_label_serialize(
1676
+ file_file_content_href=file_file_content_href,
1677
+ set_label=set_label,
1678
+ x_task_diagnostics=x_task_diagnostics,
1679
+ _request_auth=_request_auth,
1680
+ _content_type=_content_type,
1681
+ _headers=_headers,
1682
+ _host_index=_host_index
1683
+ )
1684
+
1685
+ _response_types_map: Dict[str, Optional[str]] = {
1686
+ '201': "SetLabelResponse",
1687
+ }
1688
+ response_data = self.api_client.call_api(
1689
+ *_param,
1690
+ _request_timeout=_request_timeout
1691
+ )
1692
+ return response_data.response
1693
+
1694
+
1695
+ def _set_label_serialize(
1696
+ self,
1697
+ file_file_content_href,
1698
+ set_label,
1699
+ x_task_diagnostics,
1700
+ _request_auth,
1701
+ _content_type,
1702
+ _headers,
1703
+ _host_index,
1704
+ ) -> RequestSerialized:
1705
+
1706
+ _host = None
1707
+
1708
+ _collection_formats: Dict[str, str] = {
1709
+ 'X-Task-Diagnostics': 'csv',
1710
+ }
1711
+
1712
+ _path_params: Dict[str, str] = {}
1713
+ _query_params: List[Tuple[str, str]] = []
1714
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1715
+ _form_params: List[Tuple[str, str]] = []
1716
+ _files: Dict[
1717
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1718
+ ] = {}
1719
+ _body_params: Optional[bytes] = None
1720
+
1721
+ # process the path parameters
1722
+ if file_file_content_href is not None:
1723
+ _path_params['file_file_content_href'] = file_file_content_href
1724
+ # process the query parameters
1725
+ # process the header parameters
1726
+ if x_task_diagnostics is not None:
1727
+ _header_params['X-Task-Diagnostics'] = x_task_diagnostics
1728
+ # process the form parameters
1729
+ # process the body parameter
1730
+ if set_label is not None:
1731
+ _body_params = set_label
1732
+
1733
+
1734
+ # set the HTTP header `Accept`
1735
+ if 'Accept' not in _header_params:
1736
+ _header_params['Accept'] = self.api_client.select_header_accept(
1737
+ [
1738
+ 'application/json'
1739
+ ]
1740
+ )
1741
+
1742
+ # set the HTTP header `Content-Type`
1743
+ if _content_type:
1744
+ _header_params['Content-Type'] = _content_type
1745
+ else:
1746
+ _default_content_type = (
1747
+ self.api_client.select_header_content_type(
1748
+ [
1749
+ 'application/json',
1750
+ 'application/x-www-form-urlencoded',
1751
+ 'multipart/form-data'
1752
+ ]
1753
+ )
1754
+ )
1755
+ if _default_content_type is not None:
1756
+ _header_params['Content-Type'] = _default_content_type
1757
+
1758
+ # authentication setting
1759
+ _auth_settings: List[str] = [
1760
+ 'json_header_remote_authentication',
1761
+ 'basicAuth',
1762
+ 'cookieAuth'
1763
+ ]
1764
+
1765
+ return self.api_client.param_serialize(
1766
+ method='POST',
1767
+ resource_path='{file_file_content_href}set_label/',
1768
+ path_params=_path_params,
1769
+ query_params=_query_params,
1770
+ header_params=_header_params,
1771
+ body=_body_params,
1772
+ post_params=_form_params,
1773
+ files=_files,
1774
+ auth_settings=_auth_settings,
1775
+ collection_formats=_collection_formats,
1776
+ _host=_host,
1777
+ _request_auth=_request_auth
1778
+ )
1779
+
1780
+
1781
+
1782
+
1783
+ @validate_call
1784
+ def unset_label(
1785
+ self,
1786
+ file_file_content_href: StrictStr,
1787
+ unset_label: UnsetLabel,
1788
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1789
+ _request_timeout: Union[
1790
+ None,
1791
+ Annotated[StrictFloat, Field(gt=0)],
1792
+ Tuple[
1793
+ Annotated[StrictFloat, Field(gt=0)],
1794
+ Annotated[StrictFloat, Field(gt=0)]
1795
+ ]
1796
+ ] = None,
1797
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1798
+ _content_type: Optional[StrictStr] = None,
1799
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1800
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1801
+ ) -> UnsetLabelResponse:
1802
+ """Unset a label
1803
+
1804
+ Unset a single pulp_label on the object.
1805
+
1806
+ :param file_file_content_href: (required)
1807
+ :type file_file_content_href: str
1808
+ :param unset_label: (required)
1809
+ :type unset_label: UnsetLabel
1810
+ :param x_task_diagnostics: List of profilers to use on tasks.
1811
+ :type x_task_diagnostics: List[str]
1812
+ :param _request_timeout: timeout setting for this request. If one
1813
+ number provided, it will be total request
1814
+ timeout. It can also be a pair (tuple) of
1815
+ (connection, read) timeouts.
1816
+ :type _request_timeout: int, tuple(int, int), optional
1817
+ :param _request_auth: set to override the auth_settings for an a single
1818
+ request; this effectively ignores the
1819
+ authentication in the spec for a single request.
1820
+ :type _request_auth: dict, optional
1821
+ :param _content_type: force content-type for the request.
1822
+ :type _content_type: str, Optional
1823
+ :param _headers: set to override the headers for a single
1824
+ request; this effectively ignores the headers
1825
+ in the spec for a single request.
1826
+ :type _headers: dict, optional
1827
+ :param _host_index: set to override the host_index for a single
1828
+ request; this effectively ignores the host_index
1829
+ in the spec for a single request.
1830
+ :type _host_index: int, optional
1831
+ :return: Returns the result object.
1832
+ """ # noqa: E501
1833
+
1834
+ _param = self._unset_label_serialize(
1835
+ file_file_content_href=file_file_content_href,
1836
+ unset_label=unset_label,
1837
+ x_task_diagnostics=x_task_diagnostics,
1838
+ _request_auth=_request_auth,
1839
+ _content_type=_content_type,
1840
+ _headers=_headers,
1841
+ _host_index=_host_index
1842
+ )
1843
+
1844
+ _response_types_map: Dict[str, Optional[str]] = {
1845
+ '201': "UnsetLabelResponse",
1846
+ }
1847
+ response_data = self.api_client.call_api(
1848
+ *_param,
1849
+ _request_timeout=_request_timeout
1850
+ )
1851
+ response_data.read()
1852
+ return self.api_client.response_deserialize(
1853
+ response_data=response_data,
1854
+ response_types_map=_response_types_map,
1855
+ ).data
1856
+
1857
+
1858
+ @validate_call
1859
+ def unset_label_with_http_info(
1860
+ self,
1861
+ file_file_content_href: StrictStr,
1862
+ unset_label: UnsetLabel,
1863
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1864
+ _request_timeout: Union[
1865
+ None,
1866
+ Annotated[StrictFloat, Field(gt=0)],
1867
+ Tuple[
1868
+ Annotated[StrictFloat, Field(gt=0)],
1869
+ Annotated[StrictFloat, Field(gt=0)]
1870
+ ]
1871
+ ] = None,
1872
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1873
+ _content_type: Optional[StrictStr] = None,
1874
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1875
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1876
+ ) -> ApiResponse[UnsetLabelResponse]:
1877
+ """Unset a label
1878
+
1879
+ Unset a single pulp_label on the object.
1880
+
1881
+ :param file_file_content_href: (required)
1882
+ :type file_file_content_href: str
1883
+ :param unset_label: (required)
1884
+ :type unset_label: UnsetLabel
1885
+ :param x_task_diagnostics: List of profilers to use on tasks.
1886
+ :type x_task_diagnostics: List[str]
1887
+ :param _request_timeout: timeout setting for this request. If one
1888
+ number provided, it will be total request
1889
+ timeout. It can also be a pair (tuple) of
1890
+ (connection, read) timeouts.
1891
+ :type _request_timeout: int, tuple(int, int), optional
1892
+ :param _request_auth: set to override the auth_settings for an a single
1893
+ request; this effectively ignores the
1894
+ authentication in the spec for a single request.
1895
+ :type _request_auth: dict, optional
1896
+ :param _content_type: force content-type for the request.
1897
+ :type _content_type: str, Optional
1898
+ :param _headers: set to override the headers for a single
1899
+ request; this effectively ignores the headers
1900
+ in the spec for a single request.
1901
+ :type _headers: dict, optional
1902
+ :param _host_index: set to override the host_index for a single
1903
+ request; this effectively ignores the host_index
1904
+ in the spec for a single request.
1905
+ :type _host_index: int, optional
1906
+ :return: Returns the result object.
1907
+ """ # noqa: E501
1908
+
1909
+ _param = self._unset_label_serialize(
1910
+ file_file_content_href=file_file_content_href,
1911
+ unset_label=unset_label,
1912
+ x_task_diagnostics=x_task_diagnostics,
1913
+ _request_auth=_request_auth,
1914
+ _content_type=_content_type,
1915
+ _headers=_headers,
1916
+ _host_index=_host_index
1917
+ )
1918
+
1919
+ _response_types_map: Dict[str, Optional[str]] = {
1920
+ '201': "UnsetLabelResponse",
1921
+ }
1922
+ response_data = self.api_client.call_api(
1923
+ *_param,
1924
+ _request_timeout=_request_timeout
1925
+ )
1926
+ response_data.read()
1927
+ return self.api_client.response_deserialize(
1928
+ response_data=response_data,
1929
+ response_types_map=_response_types_map,
1930
+ )
1931
+
1932
+
1933
+ @validate_call
1934
+ def unset_label_without_preload_content(
1935
+ self,
1936
+ file_file_content_href: StrictStr,
1937
+ unset_label: UnsetLabel,
1938
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
1939
+ _request_timeout: Union[
1940
+ None,
1941
+ Annotated[StrictFloat, Field(gt=0)],
1942
+ Tuple[
1943
+ Annotated[StrictFloat, Field(gt=0)],
1944
+ Annotated[StrictFloat, Field(gt=0)]
1945
+ ]
1946
+ ] = None,
1947
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1948
+ _content_type: Optional[StrictStr] = None,
1949
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1950
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1951
+ ) -> RESTResponseType:
1952
+ """Unset a label
1953
+
1954
+ Unset a single pulp_label on the object.
1955
+
1956
+ :param file_file_content_href: (required)
1957
+ :type file_file_content_href: str
1958
+ :param unset_label: (required)
1959
+ :type unset_label: UnsetLabel
1960
+ :param x_task_diagnostics: List of profilers to use on tasks.
1961
+ :type x_task_diagnostics: List[str]
1962
+ :param _request_timeout: timeout setting for this request. If one
1963
+ number provided, it will be total request
1964
+ timeout. It can also be a pair (tuple) of
1965
+ (connection, read) timeouts.
1966
+ :type _request_timeout: int, tuple(int, int), optional
1967
+ :param _request_auth: set to override the auth_settings for an a single
1968
+ request; this effectively ignores the
1969
+ authentication in the spec for a single request.
1970
+ :type _request_auth: dict, optional
1971
+ :param _content_type: force content-type for the request.
1972
+ :type _content_type: str, Optional
1973
+ :param _headers: set to override the headers for a single
1974
+ request; this effectively ignores the headers
1975
+ in the spec for a single request.
1976
+ :type _headers: dict, optional
1977
+ :param _host_index: set to override the host_index for a single
1978
+ request; this effectively ignores the host_index
1979
+ in the spec for a single request.
1980
+ :type _host_index: int, optional
1981
+ :return: Returns the result object.
1982
+ """ # noqa: E501
1983
+
1984
+ _param = self._unset_label_serialize(
1985
+ file_file_content_href=file_file_content_href,
1986
+ unset_label=unset_label,
1987
+ x_task_diagnostics=x_task_diagnostics,
1988
+ _request_auth=_request_auth,
1989
+ _content_type=_content_type,
1990
+ _headers=_headers,
1991
+ _host_index=_host_index
1992
+ )
1993
+
1994
+ _response_types_map: Dict[str, Optional[str]] = {
1995
+ '201': "UnsetLabelResponse",
1996
+ }
1997
+ response_data = self.api_client.call_api(
1998
+ *_param,
1999
+ _request_timeout=_request_timeout
2000
+ )
2001
+ return response_data.response
2002
+
2003
+
2004
+ def _unset_label_serialize(
2005
+ self,
2006
+ file_file_content_href,
2007
+ unset_label,
2008
+ x_task_diagnostics,
2009
+ _request_auth,
2010
+ _content_type,
2011
+ _headers,
2012
+ _host_index,
2013
+ ) -> RequestSerialized:
2014
+
2015
+ _host = None
2016
+
2017
+ _collection_formats: Dict[str, str] = {
2018
+ 'X-Task-Diagnostics': 'csv',
2019
+ }
2020
+
2021
+ _path_params: Dict[str, str] = {}
2022
+ _query_params: List[Tuple[str, str]] = []
2023
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2024
+ _form_params: List[Tuple[str, str]] = []
2025
+ _files: Dict[
2026
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2027
+ ] = {}
2028
+ _body_params: Optional[bytes] = None
2029
+
2030
+ # process the path parameters
2031
+ if file_file_content_href is not None:
2032
+ _path_params['file_file_content_href'] = file_file_content_href
2033
+ # process the query parameters
2034
+ # process the header parameters
2035
+ if x_task_diagnostics is not None:
2036
+ _header_params['X-Task-Diagnostics'] = x_task_diagnostics
2037
+ # process the form parameters
2038
+ # process the body parameter
2039
+ if unset_label is not None:
2040
+ _body_params = unset_label
2041
+
2042
+
2043
+ # set the HTTP header `Accept`
2044
+ if 'Accept' not in _header_params:
2045
+ _header_params['Accept'] = self.api_client.select_header_accept(
2046
+ [
2047
+ 'application/json'
2048
+ ]
2049
+ )
2050
+
2051
+ # set the HTTP header `Content-Type`
2052
+ if _content_type:
2053
+ _header_params['Content-Type'] = _content_type
2054
+ else:
2055
+ _default_content_type = (
2056
+ self.api_client.select_header_content_type(
2057
+ [
2058
+ 'application/json',
2059
+ 'application/x-www-form-urlencoded',
2060
+ 'multipart/form-data'
2061
+ ]
2062
+ )
2063
+ )
2064
+ if _default_content_type is not None:
2065
+ _header_params['Content-Type'] = _default_content_type
2066
+
2067
+ # authentication setting
2068
+ _auth_settings: List[str] = [
2069
+ 'json_header_remote_authentication',
2070
+ 'basicAuth',
2071
+ 'cookieAuth'
2072
+ ]
2073
+
2074
+ return self.api_client.param_serialize(
2075
+ method='POST',
2076
+ resource_path='{file_file_content_href}unset_label/',
2077
+ path_params=_path_params,
2078
+ query_params=_query_params,
2079
+ header_params=_header_params,
2080
+ body=_body_params,
2081
+ post_params=_form_params,
2082
+ files=_files,
2083
+ auth_settings=_auth_settings,
2084
+ collection_formats=_collection_formats,
2085
+ _host=_host,
2086
+ _request_auth=_request_auth
2087
+ )
2088
+
2089
+
2090
+
2091
+
2092
+ @validate_call
2093
+ def upload(
2094
+ self,
2095
+ relative_path: Annotated[str, Field(min_length=1, strict=True, description="Path where the artifact is located relative to distributions base_path")],
2096
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
2097
+ pulp_labels: Annotated[Optional[Dict[str, Optional[StrictStr]]], Field(description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")] = None,
2098
+ artifact: Annotated[Optional[StrictStr], Field(description="Artifact file representing the physical content")] = None,
2099
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="An uploaded file that may be turned into the content unit.")] = None,
2100
+ upload: Annotated[Optional[StrictStr], Field(description="An uncommitted upload that may be turned into the content unit.")] = None,
2101
+ file_url: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="A url that Pulp can download and turn into the content unit.")] = None,
2102
+ pulp_domain: StrictStr = "default",
2103
+ _request_timeout: Union[
2104
+ None,
2105
+ Annotated[StrictFloat, Field(gt=0)],
2106
+ Tuple[
2107
+ Annotated[StrictFloat, Field(gt=0)],
2108
+ Annotated[StrictFloat, Field(gt=0)]
2109
+ ]
2110
+ ] = None,
2111
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2112
+ _content_type: Optional[StrictStr] = None,
2113
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2114
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2115
+ ) -> FileContentUploadResponse:
2116
+ """Upload a File synchronously.
2117
+
2118
+ Synchronously upload a File.
2119
+
2120
+ :param pulp_domain: (required)
2121
+ :type pulp_domain: str
2122
+ :param relative_path: Path where the artifact is located relative to distributions base_path (required)
2123
+ :type relative_path: str
2124
+ :param x_task_diagnostics: List of profilers to use on tasks.
2125
+ :type x_task_diagnostics: List[str]
2126
+ :param pulp_labels: A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
2127
+ :type pulp_labels: Dict[str, Optional[str]]
2128
+ :param artifact: Artifact file representing the physical content
2129
+ :type artifact: str
2130
+ :param file: An uploaded file that may be turned into the content unit.
2131
+ :type file: bytearray
2132
+ :param upload: An uncommitted upload that may be turned into the content unit.
2133
+ :type upload: str
2134
+ :param file_url: A url that Pulp can download and turn into the content unit.
2135
+ :type file_url: str
2136
+ :param _request_timeout: timeout setting for this request. If one
2137
+ number provided, it will be total request
2138
+ timeout. It can also be a pair (tuple) of
2139
+ (connection, read) timeouts.
2140
+ :type _request_timeout: int, tuple(int, int), optional
2141
+ :param _request_auth: set to override the auth_settings for an a single
2142
+ request; this effectively ignores the
2143
+ authentication in the spec for a single request.
2144
+ :type _request_auth: dict, optional
2145
+ :param _content_type: force content-type for the request.
2146
+ :type _content_type: str, Optional
2147
+ :param _headers: set to override the headers for a single
2148
+ request; this effectively ignores the headers
2149
+ in the spec for a single request.
2150
+ :type _headers: dict, optional
2151
+ :param _host_index: set to override the host_index for a single
2152
+ request; this effectively ignores the host_index
2153
+ in the spec for a single request.
2154
+ :type _host_index: int, optional
2155
+ :return: Returns the result object.
2156
+ """ # noqa: E501
2157
+
2158
+ _param = self._upload_serialize(
2159
+ pulp_domain=pulp_domain,
2160
+ relative_path=relative_path,
2161
+ x_task_diagnostics=x_task_diagnostics,
2162
+ pulp_labels=pulp_labels,
2163
+ artifact=artifact,
2164
+ file=file,
2165
+ upload=upload,
2166
+ file_url=file_url,
2167
+ _request_auth=_request_auth,
2168
+ _content_type=_content_type,
2169
+ _headers=_headers,
2170
+ _host_index=_host_index
2171
+ )
2172
+
2173
+ _response_types_map: Dict[str, Optional[str]] = {
2174
+ '201': "FileContentUploadResponse",
2175
+ }
2176
+ response_data = self.api_client.call_api(
2177
+ *_param,
2178
+ _request_timeout=_request_timeout
2179
+ )
2180
+ response_data.read()
2181
+ return self.api_client.response_deserialize(
2182
+ response_data=response_data,
2183
+ response_types_map=_response_types_map,
2184
+ ).data
2185
+
2186
+
2187
+ @validate_call
2188
+ def upload_with_http_info(
2189
+ self,
2190
+ relative_path: Annotated[str, Field(min_length=1, strict=True, description="Path where the artifact is located relative to distributions base_path")],
2191
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
2192
+ pulp_labels: Annotated[Optional[Dict[str, Optional[StrictStr]]], Field(description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")] = None,
2193
+ artifact: Annotated[Optional[StrictStr], Field(description="Artifact file representing the physical content")] = None,
2194
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="An uploaded file that may be turned into the content unit.")] = None,
2195
+ upload: Annotated[Optional[StrictStr], Field(description="An uncommitted upload that may be turned into the content unit.")] = None,
2196
+ file_url: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="A url that Pulp can download and turn into the content unit.")] = None,
2197
+ pulp_domain: StrictStr = "default",
2198
+ _request_timeout: Union[
2199
+ None,
2200
+ Annotated[StrictFloat, Field(gt=0)],
2201
+ Tuple[
2202
+ Annotated[StrictFloat, Field(gt=0)],
2203
+ Annotated[StrictFloat, Field(gt=0)]
2204
+ ]
2205
+ ] = None,
2206
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2207
+ _content_type: Optional[StrictStr] = None,
2208
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2209
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2210
+ ) -> ApiResponse[FileContentUploadResponse]:
2211
+ """Upload a File synchronously.
2212
+
2213
+ Synchronously upload a File.
2214
+
2215
+ :param pulp_domain: (required)
2216
+ :type pulp_domain: str
2217
+ :param relative_path: Path where the artifact is located relative to distributions base_path (required)
2218
+ :type relative_path: str
2219
+ :param x_task_diagnostics: List of profilers to use on tasks.
2220
+ :type x_task_diagnostics: List[str]
2221
+ :param pulp_labels: A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
2222
+ :type pulp_labels: Dict[str, Optional[str]]
2223
+ :param artifact: Artifact file representing the physical content
2224
+ :type artifact: str
2225
+ :param file: An uploaded file that may be turned into the content unit.
2226
+ :type file: bytearray
2227
+ :param upload: An uncommitted upload that may be turned into the content unit.
2228
+ :type upload: str
2229
+ :param file_url: A url that Pulp can download and turn into the content unit.
2230
+ :type file_url: str
2231
+ :param _request_timeout: timeout setting for this request. If one
2232
+ number provided, it will be total request
2233
+ timeout. It can also be a pair (tuple) of
2234
+ (connection, read) timeouts.
2235
+ :type _request_timeout: int, tuple(int, int), optional
2236
+ :param _request_auth: set to override the auth_settings for an a single
2237
+ request; this effectively ignores the
2238
+ authentication in the spec for a single request.
2239
+ :type _request_auth: dict, optional
2240
+ :param _content_type: force content-type for the request.
2241
+ :type _content_type: str, Optional
2242
+ :param _headers: set to override the headers for a single
2243
+ request; this effectively ignores the headers
2244
+ in the spec for a single request.
2245
+ :type _headers: dict, optional
2246
+ :param _host_index: set to override the host_index for a single
2247
+ request; this effectively ignores the host_index
2248
+ in the spec for a single request.
2249
+ :type _host_index: int, optional
2250
+ :return: Returns the result object.
2251
+ """ # noqa: E501
2252
+
2253
+ _param = self._upload_serialize(
2254
+ pulp_domain=pulp_domain,
2255
+ relative_path=relative_path,
2256
+ x_task_diagnostics=x_task_diagnostics,
2257
+ pulp_labels=pulp_labels,
2258
+ artifact=artifact,
2259
+ file=file,
2260
+ upload=upload,
2261
+ file_url=file_url,
2262
+ _request_auth=_request_auth,
2263
+ _content_type=_content_type,
2264
+ _headers=_headers,
2265
+ _host_index=_host_index
2266
+ )
2267
+
2268
+ _response_types_map: Dict[str, Optional[str]] = {
2269
+ '201': "FileContentUploadResponse",
2270
+ }
2271
+ response_data = self.api_client.call_api(
2272
+ *_param,
2273
+ _request_timeout=_request_timeout
2274
+ )
2275
+ response_data.read()
2276
+ return self.api_client.response_deserialize(
2277
+ response_data=response_data,
2278
+ response_types_map=_response_types_map,
2279
+ )
2280
+
2281
+
2282
+ @validate_call
2283
+ def upload_without_preload_content(
2284
+ self,
2285
+ relative_path: Annotated[str, Field(min_length=1, strict=True, description="Path where the artifact is located relative to distributions base_path")],
2286
+ x_task_diagnostics: Annotated[Optional[List[StrictStr]], Field(description="List of profilers to use on tasks.")] = None,
2287
+ pulp_labels: Annotated[Optional[Dict[str, Optional[StrictStr]]], Field(description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")] = None,
2288
+ artifact: Annotated[Optional[StrictStr], Field(description="Artifact file representing the physical content")] = None,
2289
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="An uploaded file that may be turned into the content unit.")] = None,
2290
+ upload: Annotated[Optional[StrictStr], Field(description="An uncommitted upload that may be turned into the content unit.")] = None,
2291
+ file_url: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="A url that Pulp can download and turn into the content unit.")] = None,
2292
+ pulp_domain: StrictStr = "default",
2293
+ _request_timeout: Union[
2294
+ None,
2295
+ Annotated[StrictFloat, Field(gt=0)],
2296
+ Tuple[
2297
+ Annotated[StrictFloat, Field(gt=0)],
2298
+ Annotated[StrictFloat, Field(gt=0)]
2299
+ ]
2300
+ ] = None,
2301
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2302
+ _content_type: Optional[StrictStr] = None,
2303
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2304
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2305
+ ) -> RESTResponseType:
2306
+ """Upload a File synchronously.
2307
+
2308
+ Synchronously upload a File.
2309
+
2310
+ :param pulp_domain: (required)
2311
+ :type pulp_domain: str
2312
+ :param relative_path: Path where the artifact is located relative to distributions base_path (required)
2313
+ :type relative_path: str
2314
+ :param x_task_diagnostics: List of profilers to use on tasks.
2315
+ :type x_task_diagnostics: List[str]
2316
+ :param pulp_labels: A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
2317
+ :type pulp_labels: Dict[str, Optional[str]]
2318
+ :param artifact: Artifact file representing the physical content
2319
+ :type artifact: str
2320
+ :param file: An uploaded file that may be turned into the content unit.
2321
+ :type file: bytearray
2322
+ :param upload: An uncommitted upload that may be turned into the content unit.
2323
+ :type upload: str
2324
+ :param file_url: A url that Pulp can download and turn into the content unit.
2325
+ :type file_url: str
2326
+ :param _request_timeout: timeout setting for this request. If one
2327
+ number provided, it will be total request
2328
+ timeout. It can also be a pair (tuple) of
2329
+ (connection, read) timeouts.
2330
+ :type _request_timeout: int, tuple(int, int), optional
2331
+ :param _request_auth: set to override the auth_settings for an a single
2332
+ request; this effectively ignores the
2333
+ authentication in the spec for a single request.
2334
+ :type _request_auth: dict, optional
2335
+ :param _content_type: force content-type for the request.
2336
+ :type _content_type: str, Optional
2337
+ :param _headers: set to override the headers for a single
2338
+ request; this effectively ignores the headers
2339
+ in the spec for a single request.
2340
+ :type _headers: dict, optional
2341
+ :param _host_index: set to override the host_index for a single
2342
+ request; this effectively ignores the host_index
2343
+ in the spec for a single request.
2344
+ :type _host_index: int, optional
2345
+ :return: Returns the result object.
2346
+ """ # noqa: E501
2347
+
2348
+ _param = self._upload_serialize(
2349
+ pulp_domain=pulp_domain,
2350
+ relative_path=relative_path,
2351
+ x_task_diagnostics=x_task_diagnostics,
2352
+ pulp_labels=pulp_labels,
2353
+ artifact=artifact,
2354
+ file=file,
2355
+ upload=upload,
2356
+ file_url=file_url,
2357
+ _request_auth=_request_auth,
2358
+ _content_type=_content_type,
2359
+ _headers=_headers,
2360
+ _host_index=_host_index
2361
+ )
2362
+
2363
+ _response_types_map: Dict[str, Optional[str]] = {
2364
+ '201': "FileContentUploadResponse",
2365
+ }
2366
+ response_data = self.api_client.call_api(
2367
+ *_param,
2368
+ _request_timeout=_request_timeout
2369
+ )
2370
+ return response_data.response
2371
+
2372
+
2373
+ def _upload_serialize(
2374
+ self,
2375
+ pulp_domain,
2376
+ relative_path,
2377
+ x_task_diagnostics,
2378
+ pulp_labels,
2379
+ artifact,
2380
+ file,
2381
+ upload,
2382
+ file_url,
2383
+ _request_auth,
2384
+ _content_type,
2385
+ _headers,
2386
+ _host_index,
2387
+ ) -> RequestSerialized:
2388
+
2389
+ _host = None
2390
+
2391
+ _collection_formats: Dict[str, str] = {
2392
+ 'X-Task-Diagnostics': 'csv',
2393
+ }
2394
+
2395
+ _path_params: Dict[str, str] = {}
2396
+ _query_params: List[Tuple[str, str]] = []
2397
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2398
+ _form_params: List[Tuple[str, str]] = []
2399
+ _files: Dict[
2400
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2401
+ ] = {}
2402
+ _body_params: Optional[bytes] = None
2403
+
2404
+ # process the path parameters
2405
+ if pulp_domain is not None:
2406
+ _path_params['pulp_domain'] = pulp_domain
2407
+ # process the query parameters
2408
+ # process the header parameters
2409
+ if x_task_diagnostics is not None:
2410
+ _header_params['X-Task-Diagnostics'] = x_task_diagnostics
2411
+ # process the form parameters
2412
+ if pulp_labels is not None:
2413
+ _form_params.append(('pulp_labels', pulp_labels))
2414
+ if artifact is not None:
2415
+ _form_params.append(('artifact', artifact))
2416
+ if relative_path is not None:
2417
+ _form_params.append(('relative_path', relative_path))
2418
+ if file is not None:
2419
+ _files['file'] = file
2420
+ if upload is not None:
2421
+ _form_params.append(('upload', upload))
2422
+ if file_url is not None:
2423
+ _form_params.append(('file_url', file_url))
2424
+ # process the body parameter
2425
+
2426
+
2427
+ # set the HTTP header `Accept`
2428
+ if 'Accept' not in _header_params:
2429
+ _header_params['Accept'] = self.api_client.select_header_accept(
2430
+ [
2431
+ 'application/json'
2432
+ ]
2433
+ )
2434
+
2435
+ # set the HTTP header `Content-Type`
2436
+ if _content_type:
2437
+ _header_params['Content-Type'] = _content_type
2438
+ else:
2439
+ _default_content_type = (
2440
+ self.api_client.select_header_content_type(
2441
+ [
2442
+ 'multipart/form-data',
2443
+ 'application/x-www-form-urlencoded'
2444
+ ]
2445
+ )
2446
+ )
2447
+ if _default_content_type is not None:
2448
+ _header_params['Content-Type'] = _default_content_type
2449
+
2450
+ # authentication setting
2451
+ _auth_settings: List[str] = [
2452
+ 'json_header_remote_authentication',
2453
+ 'basicAuth',
2454
+ 'cookieAuth'
2455
+ ]
2456
+
2457
+ return self.api_client.param_serialize(
2458
+ method='POST',
2459
+ resource_path='/api/pulp/{pulp_domain}/api/v3/content/file/files/upload/',
2460
+ path_params=_path_params,
2461
+ query_params=_query_params,
2462
+ header_params=_header_params,
2463
+ body=_body_params,
2464
+ post_params=_form_params,
2465
+ files=_files,
2466
+ auth_settings=_auth_settings,
2467
+ collection_formats=_collection_formats,
2468
+ _host=_host,
2469
+ _request_auth=_request_auth
2470
+ )
2471
+
2472
+