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,121 @@
|
|
|
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, StrictBool, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class FileFileRepository(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Serializer for File Repositories.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
|
|
32
|
+
name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique name for this repository.")
|
|
33
|
+
description: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="An optional description.")
|
|
34
|
+
retain_repo_versions: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Retain X versions of the repository. Default is null which retains all versions.")
|
|
35
|
+
remote: Optional[StrictStr] = Field(default=None, description="An optional remote to use by default when syncing.")
|
|
36
|
+
autopublish: Optional[StrictBool] = Field(default=False, description="Whether to automatically create publications for new repository versions, and update any distributions pointing to this repository.")
|
|
37
|
+
manifest: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default='PULP_MANIFEST', description="Filename to use for manifest file containing metadata for all the files.")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["pulp_labels", "name", "description", "retain_repo_versions", "remote", "autopublish", "manifest"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of FileFileRepository from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
# set to None if description (nullable) is None
|
|
80
|
+
# and model_fields_set contains the field
|
|
81
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
82
|
+
_dict['description'] = None
|
|
83
|
+
|
|
84
|
+
# set to None if retain_repo_versions (nullable) is None
|
|
85
|
+
# and model_fields_set contains the field
|
|
86
|
+
if self.retain_repo_versions is None and "retain_repo_versions" in self.model_fields_set:
|
|
87
|
+
_dict['retain_repo_versions'] = None
|
|
88
|
+
|
|
89
|
+
# set to None if remote (nullable) is None
|
|
90
|
+
# and model_fields_set contains the field
|
|
91
|
+
if self.remote is None and "remote" in self.model_fields_set:
|
|
92
|
+
_dict['remote'] = None
|
|
93
|
+
|
|
94
|
+
# set to None if manifest (nullable) is None
|
|
95
|
+
# and model_fields_set contains the field
|
|
96
|
+
if self.manifest is None and "manifest" in self.model_fields_set:
|
|
97
|
+
_dict['manifest'] = None
|
|
98
|
+
|
|
99
|
+
return _dict
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
103
|
+
"""Create an instance of FileFileRepository from a dict"""
|
|
104
|
+
if obj is None:
|
|
105
|
+
return None
|
|
106
|
+
|
|
107
|
+
if not isinstance(obj, dict):
|
|
108
|
+
return cls.model_validate(obj)
|
|
109
|
+
|
|
110
|
+
_obj = cls.model_validate({
|
|
111
|
+
"pulp_labels": obj.get("pulp_labels"),
|
|
112
|
+
"name": obj.get("name"),
|
|
113
|
+
"description": obj.get("description"),
|
|
114
|
+
"retain_repo_versions": obj.get("retain_repo_versions"),
|
|
115
|
+
"remote": obj.get("remote"),
|
|
116
|
+
"autopublish": obj.get("autopublish") if obj.get("autopublish") is not None else False,
|
|
117
|
+
"manifest": obj.get("manifest") if obj.get("manifest") is not None else 'PULP_MANIFEST'
|
|
118
|
+
})
|
|
119
|
+
return _obj
|
|
120
|
+
|
|
121
|
+
|
|
@@ -0,0 +1,146 @@
|
|
|
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, StrictBool, 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 FileFileRepositoryResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Serializer for File Repositories.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
pulp_href: Optional[StrictStr] = None
|
|
33
|
+
prn: Optional[StrictStr] = Field(default=None, description="The Pulp Resource Name (PRN).")
|
|
34
|
+
pulp_created: Optional[datetime] = Field(default=None, description="Timestamp of creation.")
|
|
35
|
+
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.")
|
|
36
|
+
versions_href: Optional[StrictStr] = None
|
|
37
|
+
pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
|
|
38
|
+
latest_version_href: Optional[StrictStr] = None
|
|
39
|
+
name: StrictStr = Field(description="A unique name for this repository.")
|
|
40
|
+
description: Optional[StrictStr] = Field(default=None, description="An optional description.")
|
|
41
|
+
retain_repo_versions: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Retain X versions of the repository. Default is null which retains all versions.")
|
|
42
|
+
remote: Optional[StrictStr] = Field(default=None, description="An optional remote to use by default when syncing.")
|
|
43
|
+
autopublish: Optional[StrictBool] = Field(default=False, description="Whether to automatically create publications for new repository versions, and update any distributions pointing to this repository.")
|
|
44
|
+
manifest: Optional[StrictStr] = Field(default='PULP_MANIFEST', description="Filename to use for manifest file containing metadata for all the files.")
|
|
45
|
+
__properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "versions_href", "pulp_labels", "latest_version_href", "name", "description", "retain_repo_versions", "remote", "autopublish", "manifest"]
|
|
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 FileFileRepositoryResponse 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
|
+
"""
|
|
84
|
+
excluded_fields: Set[str] = set([
|
|
85
|
+
"pulp_href",
|
|
86
|
+
"prn",
|
|
87
|
+
"pulp_created",
|
|
88
|
+
"pulp_last_updated",
|
|
89
|
+
"versions_href",
|
|
90
|
+
"latest_version_href",
|
|
91
|
+
])
|
|
92
|
+
|
|
93
|
+
_dict = self.model_dump(
|
|
94
|
+
by_alias=True,
|
|
95
|
+
exclude=excluded_fields,
|
|
96
|
+
exclude_none=True,
|
|
97
|
+
)
|
|
98
|
+
# set to None if description (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
101
|
+
_dict['description'] = None
|
|
102
|
+
|
|
103
|
+
# set to None if retain_repo_versions (nullable) is None
|
|
104
|
+
# and model_fields_set contains the field
|
|
105
|
+
if self.retain_repo_versions is None and "retain_repo_versions" in self.model_fields_set:
|
|
106
|
+
_dict['retain_repo_versions'] = None
|
|
107
|
+
|
|
108
|
+
# set to None if remote (nullable) is None
|
|
109
|
+
# and model_fields_set contains the field
|
|
110
|
+
if self.remote is None and "remote" in self.model_fields_set:
|
|
111
|
+
_dict['remote'] = None
|
|
112
|
+
|
|
113
|
+
# set to None if manifest (nullable) is None
|
|
114
|
+
# and model_fields_set contains the field
|
|
115
|
+
if self.manifest is None and "manifest" in self.model_fields_set:
|
|
116
|
+
_dict['manifest'] = None
|
|
117
|
+
|
|
118
|
+
return _dict
|
|
119
|
+
|
|
120
|
+
@classmethod
|
|
121
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
122
|
+
"""Create an instance of FileFileRepositoryResponse from a dict"""
|
|
123
|
+
if obj is None:
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
if not isinstance(obj, dict):
|
|
127
|
+
return cls.model_validate(obj)
|
|
128
|
+
|
|
129
|
+
_obj = cls.model_validate({
|
|
130
|
+
"pulp_href": obj.get("pulp_href"),
|
|
131
|
+
"prn": obj.get("prn"),
|
|
132
|
+
"pulp_created": obj.get("pulp_created"),
|
|
133
|
+
"pulp_last_updated": obj.get("pulp_last_updated"),
|
|
134
|
+
"versions_href": obj.get("versions_href"),
|
|
135
|
+
"pulp_labels": obj.get("pulp_labels"),
|
|
136
|
+
"latest_version_href": obj.get("latest_version_href"),
|
|
137
|
+
"name": obj.get("name"),
|
|
138
|
+
"description": obj.get("description"),
|
|
139
|
+
"retain_repo_versions": obj.get("retain_repo_versions"),
|
|
140
|
+
"remote": obj.get("remote"),
|
|
141
|
+
"autopublish": obj.get("autopublish") if obj.get("autopublish") is not None else False,
|
|
142
|
+
"manifest": obj.get("manifest") if obj.get("manifest") is not None else 'PULP_MANIFEST'
|
|
143
|
+
})
|
|
144
|
+
return _obj
|
|
145
|
+
|
|
146
|
+
|
|
@@ -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, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class MyPermissionsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
MyPermissionsResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
permissions: List[StrictStr]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["permissions"]
|
|
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 MyPermissionsResponse 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 MyPermissionsResponse 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
|
+
"permissions": obj.get("permissions")
|
|
85
|
+
})
|
|
86
|
+
return _obj
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class NestedRole(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Serializer to add/remove object roles to/from users/groups. This is used in conjunction with ``pulpcore.app.viewsets.base.RolesMixin`` and requires the underlying object to be passed as ``content_object`` in the context.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
users: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None
|
|
32
|
+
groups: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None
|
|
33
|
+
role: Annotated[str, Field(min_length=1, strict=True)]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["users", "groups", "role"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of NestedRole from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of NestedRole from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"users": obj.get("users"),
|
|
88
|
+
"groups": obj.get("groups"),
|
|
89
|
+
"role": obj.get("role")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -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, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class NestedRoleResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Serializer to add/remove object roles to/from users/groups. This is used in conjunction with ``pulpcore.app.viewsets.base.RolesMixin`` and requires the underlying object to be passed as ``content_object`` in the context.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
users: Optional[List[StrictStr]] = None
|
|
31
|
+
groups: Optional[List[StrictStr]] = None
|
|
32
|
+
role: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["users", "groups", "role"]
|
|
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 NestedRoleResponse 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 NestedRoleResponse 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
|
+
"users": obj.get("users"),
|
|
87
|
+
"groups": obj.get("groups"),
|
|
88
|
+
"role": obj.get("role")
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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 pulpcore.client.pulp_file.models.nested_role_response import NestedRoleResponse
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class ObjectRolesResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ObjectRolesResponse
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
roles: List[NestedRoleResponse]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["roles"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of ObjectRolesResponse from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of each item in roles (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.roles:
|
|
76
|
+
for _item_roles in self.roles:
|
|
77
|
+
if _item_roles:
|
|
78
|
+
_items.append(_item_roles.to_dict())
|
|
79
|
+
_dict['roles'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ObjectRolesResponse from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"roles": [NestedRoleResponse.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|