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.
- crc_pulp_file_client-20251209.2.dist-info/METADATA +8160 -0
- crc_pulp_file_client-20251209.2.dist-info/RECORD +62 -0
- crc_pulp_file_client-20251209.2.dist-info/WHEEL +5 -0
- crc_pulp_file_client-20251209.2.dist-info/top_level.txt +1 -0
- pulpcore/__init__.py +2 -0
- pulpcore/client/__init__.py +2 -0
- pulpcore/client/pulp_file/__init__.py +80 -0
- pulpcore/client/pulp_file/api/__init__.py +11 -0
- pulpcore/client/pulp_file/api/acs_file_api.py +3695 -0
- pulpcore/client/pulp_file/api/content_files_api.py +2472 -0
- pulpcore/client/pulp_file/api/distributions_file_api.py +4192 -0
- pulpcore/client/pulp_file/api/publications_file_api.py +2881 -0
- pulpcore/client/pulp_file/api/remotes_file_api.py +4220 -0
- pulpcore/client/pulp_file/api/repositories_file_api.py +4862 -0
- pulpcore/client/pulp_file/api/repositories_file_versions_api.py +1670 -0
- pulpcore/client/pulp_file/api_client.py +798 -0
- pulpcore/client/pulp_file/api_response.py +21 -0
- pulpcore/client/pulp_file/configuration.py +628 -0
- pulpcore/client/pulp_file/exceptions.py +200 -0
- pulpcore/client/pulp_file/models/__init__.py +57 -0
- pulpcore/client/pulp_file/models/async_operation_response.py +88 -0
- pulpcore/client/pulp_file/models/content_summary_response.py +92 -0
- pulpcore/client/pulp_file/models/file_content_upload_response.py +137 -0
- pulpcore/client/pulp_file/models/file_file_alternate_content_source.py +101 -0
- pulpcore/client/pulp_file/models/file_file_alternate_content_source_response.py +116 -0
- pulpcore/client/pulp_file/models/file_file_content_response.py +137 -0
- pulpcore/client/pulp_file/models/file_file_distribution.py +118 -0
- pulpcore/client/pulp_file/models/file_file_distribution_response.py +142 -0
- pulpcore/client/pulp_file/models/file_file_publication.py +100 -0
- pulpcore/client/pulp_file/models/file_file_publication_response.py +120 -0
- pulpcore/client/pulp_file/models/file_file_remote.py +205 -0
- pulpcore/client/pulp_file/models/file_file_remote_response.py +199 -0
- pulpcore/client/pulp_file/models/file_file_remote_response_hidden_fields_inner.py +90 -0
- pulpcore/client/pulp_file/models/file_file_repository.py +121 -0
- pulpcore/client/pulp_file/models/file_file_repository_response.py +146 -0
- pulpcore/client/pulp_file/models/my_permissions_response.py +88 -0
- pulpcore/client/pulp_file/models/nested_role.py +93 -0
- pulpcore/client/pulp_file/models/nested_role_response.py +92 -0
- pulpcore/client/pulp_file/models/object_roles_response.py +96 -0
- pulpcore/client/pulp_file/models/paginated_repository_version_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_alternate_content_source_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_content_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_distribution_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_publication_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_remote_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_repository_response_list.py +112 -0
- pulpcore/client/pulp_file/models/patchedfile_file_alternate_content_source.py +101 -0
- pulpcore/client/pulp_file/models/patchedfile_file_distribution.py +118 -0
- pulpcore/client/pulp_file/models/patchedfile_file_remote.py +205 -0
- pulpcore/client/pulp_file/models/patchedfile_file_repository.py +121 -0
- pulpcore/client/pulp_file/models/policy_enum.py +39 -0
- pulpcore/client/pulp_file/models/repair.py +88 -0
- pulpcore/client/pulp_file/models/repository_add_remove_content.py +93 -0
- pulpcore/client/pulp_file/models/repository_sync_url.py +90 -0
- pulpcore/client/pulp_file/models/repository_version_response.py +125 -0
- pulpcore/client/pulp_file/models/set_label.py +103 -0
- pulpcore/client/pulp_file/models/set_label_response.py +103 -0
- pulpcore/client/pulp_file/models/task_group_operation_response.py +88 -0
- pulpcore/client/pulp_file/models/unset_label.py +96 -0
- pulpcore/client/pulp_file/models/unset_label_response.py +100 -0
- pulpcore/client/pulp_file/py.typed +0 -0
- pulpcore/client/pulp_file/rest.py +258 -0
|
@@ -0,0 +1,200 @@
|
|
|
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
|
+
from typing import Any, Optional
|
|
16
|
+
from typing_extensions import Self
|
|
17
|
+
|
|
18
|
+
class OpenApiException(Exception):
|
|
19
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
23
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
24
|
+
key_type=None) -> None:
|
|
25
|
+
""" Raises an exception for TypeErrors
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
msg (str): the exception message
|
|
29
|
+
|
|
30
|
+
Keyword Args:
|
|
31
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
32
|
+
current_item
|
|
33
|
+
None if unset
|
|
34
|
+
valid_classes (tuple): the primitive classes that current item
|
|
35
|
+
should be an instance of
|
|
36
|
+
None if unset
|
|
37
|
+
key_type (bool): False if our value is a value in a dict
|
|
38
|
+
True if it is a key in a dict
|
|
39
|
+
False if our item is an item in a list
|
|
40
|
+
None if unset
|
|
41
|
+
"""
|
|
42
|
+
self.path_to_item = path_to_item
|
|
43
|
+
self.valid_classes = valid_classes
|
|
44
|
+
self.key_type = key_type
|
|
45
|
+
full_msg = msg
|
|
46
|
+
if path_to_item:
|
|
47
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
48
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
52
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
53
|
+
"""
|
|
54
|
+
Args:
|
|
55
|
+
msg (str): the exception message
|
|
56
|
+
|
|
57
|
+
Keyword Args:
|
|
58
|
+
path_to_item (list) the path to the exception in the
|
|
59
|
+
received_data dict. None if unset
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
self.path_to_item = path_to_item
|
|
63
|
+
full_msg = msg
|
|
64
|
+
if path_to_item:
|
|
65
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
66
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
70
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
71
|
+
"""
|
|
72
|
+
Raised when an attribute reference or assignment fails.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
msg (str): the exception message
|
|
76
|
+
|
|
77
|
+
Keyword Args:
|
|
78
|
+
path_to_item (None/list) the path to the exception in the
|
|
79
|
+
received_data dict
|
|
80
|
+
"""
|
|
81
|
+
self.path_to_item = path_to_item
|
|
82
|
+
full_msg = msg
|
|
83
|
+
if path_to_item:
|
|
84
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
85
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
89
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
90
|
+
"""
|
|
91
|
+
Args:
|
|
92
|
+
msg (str): the exception message
|
|
93
|
+
|
|
94
|
+
Keyword Args:
|
|
95
|
+
path_to_item (None/list) the path to the exception in the
|
|
96
|
+
received_data dict
|
|
97
|
+
"""
|
|
98
|
+
self.path_to_item = path_to_item
|
|
99
|
+
full_msg = msg
|
|
100
|
+
if path_to_item:
|
|
101
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
102
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class ApiException(OpenApiException):
|
|
106
|
+
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
status=None,
|
|
110
|
+
reason=None,
|
|
111
|
+
http_resp=None,
|
|
112
|
+
*,
|
|
113
|
+
body: Optional[str] = None,
|
|
114
|
+
data: Optional[Any] = None,
|
|
115
|
+
) -> None:
|
|
116
|
+
self.status = status
|
|
117
|
+
self.reason = reason
|
|
118
|
+
self.body = body
|
|
119
|
+
self.data = data
|
|
120
|
+
self.headers = None
|
|
121
|
+
|
|
122
|
+
if http_resp:
|
|
123
|
+
if self.status is None:
|
|
124
|
+
self.status = http_resp.status
|
|
125
|
+
if self.reason is None:
|
|
126
|
+
self.reason = http_resp.reason
|
|
127
|
+
if self.body is None:
|
|
128
|
+
try:
|
|
129
|
+
self.body = http_resp.data.decode('utf-8')
|
|
130
|
+
except Exception:
|
|
131
|
+
pass
|
|
132
|
+
self.headers = http_resp.getheaders()
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def from_response(
|
|
136
|
+
cls,
|
|
137
|
+
*,
|
|
138
|
+
http_resp,
|
|
139
|
+
body: Optional[str],
|
|
140
|
+
data: Optional[Any],
|
|
141
|
+
) -> Self:
|
|
142
|
+
if http_resp.status == 400:
|
|
143
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
144
|
+
|
|
145
|
+
if http_resp.status == 401:
|
|
146
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
147
|
+
|
|
148
|
+
if http_resp.status == 403:
|
|
149
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
150
|
+
|
|
151
|
+
if http_resp.status == 404:
|
|
152
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
153
|
+
|
|
154
|
+
if 500 <= http_resp.status <= 599:
|
|
155
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
156
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
157
|
+
|
|
158
|
+
def __str__(self):
|
|
159
|
+
"""Custom error messages for exception"""
|
|
160
|
+
error_message = "({0})\n"\
|
|
161
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
162
|
+
if self.headers:
|
|
163
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
164
|
+
self.headers)
|
|
165
|
+
|
|
166
|
+
if self.data or self.body:
|
|
167
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
168
|
+
|
|
169
|
+
return error_message
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class BadRequestException(ApiException):
|
|
173
|
+
pass
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class NotFoundException(ApiException):
|
|
177
|
+
pass
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class UnauthorizedException(ApiException):
|
|
181
|
+
pass
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class ForbiddenException(ApiException):
|
|
185
|
+
pass
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class ServiceException(ApiException):
|
|
189
|
+
pass
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def render_path(path_to_item):
|
|
193
|
+
"""Returns a string representation of a path"""
|
|
194
|
+
result = ""
|
|
195
|
+
for pth in path_to_item:
|
|
196
|
+
if isinstance(pth, int):
|
|
197
|
+
result += "[{0}]".format(pth)
|
|
198
|
+
else:
|
|
199
|
+
result += "['{0}']".format(pth)
|
|
200
|
+
return result
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Pulp 3 API
|
|
6
|
+
|
|
7
|
+
Fetch, Upload, Organize, and Distribute Software Packages
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: v3
|
|
10
|
+
Contact: pulp-list@redhat.com
|
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
+
|
|
13
|
+
Do not edit the class manually.
|
|
14
|
+
""" # noqa: E501
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# import models into model package
|
|
18
|
+
from pulpcore.client.pulp_file.models.async_operation_response import AsyncOperationResponse
|
|
19
|
+
from pulpcore.client.pulp_file.models.content_summary_response import ContentSummaryResponse
|
|
20
|
+
from pulpcore.client.pulp_file.models.file_content_upload_response import FileContentUploadResponse
|
|
21
|
+
from pulpcore.client.pulp_file.models.file_file_alternate_content_source import FileFileAlternateContentSource
|
|
22
|
+
from pulpcore.client.pulp_file.models.file_file_alternate_content_source_response import FileFileAlternateContentSourceResponse
|
|
23
|
+
from pulpcore.client.pulp_file.models.file_file_content_response import FileFileContentResponse
|
|
24
|
+
from pulpcore.client.pulp_file.models.file_file_distribution import FileFileDistribution
|
|
25
|
+
from pulpcore.client.pulp_file.models.file_file_distribution_response import FileFileDistributionResponse
|
|
26
|
+
from pulpcore.client.pulp_file.models.file_file_publication import FileFilePublication
|
|
27
|
+
from pulpcore.client.pulp_file.models.file_file_publication_response import FileFilePublicationResponse
|
|
28
|
+
from pulpcore.client.pulp_file.models.file_file_remote import FileFileRemote
|
|
29
|
+
from pulpcore.client.pulp_file.models.file_file_remote_response import FileFileRemoteResponse
|
|
30
|
+
from pulpcore.client.pulp_file.models.file_file_remote_response_hidden_fields_inner import FileFileRemoteResponseHiddenFieldsInner
|
|
31
|
+
from pulpcore.client.pulp_file.models.file_file_repository import FileFileRepository
|
|
32
|
+
from pulpcore.client.pulp_file.models.file_file_repository_response import FileFileRepositoryResponse
|
|
33
|
+
from pulpcore.client.pulp_file.models.my_permissions_response import MyPermissionsResponse
|
|
34
|
+
from pulpcore.client.pulp_file.models.nested_role import NestedRole
|
|
35
|
+
from pulpcore.client.pulp_file.models.nested_role_response import NestedRoleResponse
|
|
36
|
+
from pulpcore.client.pulp_file.models.object_roles_response import ObjectRolesResponse
|
|
37
|
+
from pulpcore.client.pulp_file.models.paginated_repository_version_response_list import PaginatedRepositoryVersionResponseList
|
|
38
|
+
from pulpcore.client.pulp_file.models.paginatedfile_file_alternate_content_source_response_list import PaginatedfileFileAlternateContentSourceResponseList
|
|
39
|
+
from pulpcore.client.pulp_file.models.paginatedfile_file_content_response_list import PaginatedfileFileContentResponseList
|
|
40
|
+
from pulpcore.client.pulp_file.models.paginatedfile_file_distribution_response_list import PaginatedfileFileDistributionResponseList
|
|
41
|
+
from pulpcore.client.pulp_file.models.paginatedfile_file_publication_response_list import PaginatedfileFilePublicationResponseList
|
|
42
|
+
from pulpcore.client.pulp_file.models.paginatedfile_file_remote_response_list import PaginatedfileFileRemoteResponseList
|
|
43
|
+
from pulpcore.client.pulp_file.models.paginatedfile_file_repository_response_list import PaginatedfileFileRepositoryResponseList
|
|
44
|
+
from pulpcore.client.pulp_file.models.patchedfile_file_alternate_content_source import PatchedfileFileAlternateContentSource
|
|
45
|
+
from pulpcore.client.pulp_file.models.patchedfile_file_distribution import PatchedfileFileDistribution
|
|
46
|
+
from pulpcore.client.pulp_file.models.patchedfile_file_remote import PatchedfileFileRemote
|
|
47
|
+
from pulpcore.client.pulp_file.models.patchedfile_file_repository import PatchedfileFileRepository
|
|
48
|
+
from pulpcore.client.pulp_file.models.policy_enum import PolicyEnum
|
|
49
|
+
from pulpcore.client.pulp_file.models.repair import Repair
|
|
50
|
+
from pulpcore.client.pulp_file.models.repository_add_remove_content import RepositoryAddRemoveContent
|
|
51
|
+
from pulpcore.client.pulp_file.models.repository_sync_url import RepositorySyncURL
|
|
52
|
+
from pulpcore.client.pulp_file.models.repository_version_response import RepositoryVersionResponse
|
|
53
|
+
from pulpcore.client.pulp_file.models.set_label import SetLabel
|
|
54
|
+
from pulpcore.client.pulp_file.models.set_label_response import SetLabelResponse
|
|
55
|
+
from pulpcore.client.pulp_file.models.task_group_operation_response import TaskGroupOperationResponse
|
|
56
|
+
from pulpcore.client.pulp_file.models.unset_label import UnsetLabel
|
|
57
|
+
from pulpcore.client.pulp_file.models.unset_label_response import UnsetLabelResponse
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class AsyncOperationResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Serializer for asynchronous operations.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
task: StrictStr = Field(description="The href of the task.")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["task"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of AsyncOperationResponse from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of AsyncOperationResponse from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"task": obj.get("task")
|
|
85
|
+
})
|
|
86
|
+
return _obj
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ContentSummaryResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Serializer for the RepositoryVersion content summary
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
added: Dict[str, Dict[str, Any]]
|
|
31
|
+
removed: Dict[str, Dict[str, Any]]
|
|
32
|
+
present: Dict[str, Dict[str, Any]]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["added", "removed", "present"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of ContentSummaryResponse from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of ContentSummaryResponse from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"added": obj.get("added"),
|
|
87
|
+
"removed": obj.get("removed"),
|
|
88
|
+
"present": obj.get("present")
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class FileContentUploadResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Serializer for File Content.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
pulp_href: Optional[StrictStr] = None
|
|
32
|
+
prn: Optional[StrictStr] = Field(default=None, description="The Pulp Resource Name (PRN).")
|
|
33
|
+
pulp_created: Optional[datetime] = Field(default=None, description="Timestamp of creation.")
|
|
34
|
+
pulp_last_updated: Optional[datetime] = Field(default=None, description="Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.")
|
|
35
|
+
pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = Field(default=None, description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")
|
|
36
|
+
vuln_report: Optional[StrictStr] = None
|
|
37
|
+
artifact: Optional[StrictStr] = Field(default=None, description="Artifact file representing the physical content")
|
|
38
|
+
relative_path: StrictStr = Field(description="Path where the artifact is located relative to distributions base_path")
|
|
39
|
+
md5: Optional[StrictStr] = Field(default=None, description="The MD5 checksum if available.")
|
|
40
|
+
sha1: Optional[StrictStr] = Field(default=None, description="The SHA-1 checksum if available.")
|
|
41
|
+
sha224: Optional[StrictStr] = Field(default=None, description="The SHA-224 checksum if available.")
|
|
42
|
+
sha256: Optional[StrictStr] = Field(default=None, description="The SHA-256 checksum if available.")
|
|
43
|
+
sha384: Optional[StrictStr] = Field(default=None, description="The SHA-384 checksum if available.")
|
|
44
|
+
sha512: Optional[StrictStr] = Field(default=None, description="The SHA-512 checksum if available.")
|
|
45
|
+
__properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "pulp_labels", "vuln_report", "artifact", "relative_path", "md5", "sha1", "sha224", "sha256", "sha384", "sha512"]
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
populate_by_name=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of FileContentUploadResponse from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
78
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
79
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
80
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
81
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
82
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
83
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
84
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
85
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
86
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
87
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
88
|
+
"""
|
|
89
|
+
excluded_fields: Set[str] = set([
|
|
90
|
+
"pulp_href",
|
|
91
|
+
"prn",
|
|
92
|
+
"pulp_created",
|
|
93
|
+
"pulp_last_updated",
|
|
94
|
+
"vuln_report",
|
|
95
|
+
"md5",
|
|
96
|
+
"sha1",
|
|
97
|
+
"sha224",
|
|
98
|
+
"sha256",
|
|
99
|
+
"sha384",
|
|
100
|
+
"sha512",
|
|
101
|
+
])
|
|
102
|
+
|
|
103
|
+
_dict = self.model_dump(
|
|
104
|
+
by_alias=True,
|
|
105
|
+
exclude=excluded_fields,
|
|
106
|
+
exclude_none=True,
|
|
107
|
+
)
|
|
108
|
+
return _dict
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
112
|
+
"""Create an instance of FileContentUploadResponse from a dict"""
|
|
113
|
+
if obj is None:
|
|
114
|
+
return None
|
|
115
|
+
|
|
116
|
+
if not isinstance(obj, dict):
|
|
117
|
+
return cls.model_validate(obj)
|
|
118
|
+
|
|
119
|
+
_obj = cls.model_validate({
|
|
120
|
+
"pulp_href": obj.get("pulp_href"),
|
|
121
|
+
"prn": obj.get("prn"),
|
|
122
|
+
"pulp_created": obj.get("pulp_created"),
|
|
123
|
+
"pulp_last_updated": obj.get("pulp_last_updated"),
|
|
124
|
+
"pulp_labels": obj.get("pulp_labels"),
|
|
125
|
+
"vuln_report": obj.get("vuln_report"),
|
|
126
|
+
"artifact": obj.get("artifact"),
|
|
127
|
+
"relative_path": obj.get("relative_path"),
|
|
128
|
+
"md5": obj.get("md5"),
|
|
129
|
+
"sha1": obj.get("sha1"),
|
|
130
|
+
"sha224": obj.get("sha224"),
|
|
131
|
+
"sha256": obj.get("sha256"),
|
|
132
|
+
"sha384": obj.get("sha384"),
|
|
133
|
+
"sha512": obj.get("sha512")
|
|
134
|
+
})
|
|
135
|
+
return _obj
|
|
136
|
+
|
|
137
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class FileFileAlternateContentSource(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Serializer for File alternate content source.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of Alternate Content Source.")
|
|
33
|
+
last_refreshed: Optional[datetime] = Field(default=None, description="Date of last refresh of AlternateContentSource.")
|
|
34
|
+
paths: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = Field(default=None, description="List of paths that will be appended to the Remote url when searching for content.")
|
|
35
|
+
remote: StrictStr = Field(description="The remote to provide alternate content source.")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["name", "last_refreshed", "paths", "remote"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of FileFileAlternateContentSource from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# set to None if last_refreshed (nullable) is None
|
|
78
|
+
# and model_fields_set contains the field
|
|
79
|
+
if self.last_refreshed is None and "last_refreshed" in self.model_fields_set:
|
|
80
|
+
_dict['last_refreshed'] = None
|
|
81
|
+
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of FileFileAlternateContentSource from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"name": obj.get("name"),
|
|
95
|
+
"last_refreshed": obj.get("last_refreshed"),
|
|
96
|
+
"paths": obj.get("paths"),
|
|
97
|
+
"remote": obj.get("remote")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|