crc-pulpcore-client 20250819.1__py3-none-any.whl → 20250820.1__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-pulpcore-client might be problematic. Click here for more details.
- crc-pulpcore-client/api_client.py +1 -1
- crc-pulpcore-client/configuration.py +3 -3
- crc-pulpcore-client/models/artifact_distribution_response.py +17 -17
- {crc_pulpcore_client-20250819.1.dist-info → crc_pulpcore_client-20250820.1.dist-info}/METADATA +1 -1
- crc_pulpcore_client-20250820.1.dist-info/RECORD +234 -0
- crc_pulpcore_client-20250820.1.dist-info/top_level.txt +1 -0
- crc_pulpcore_client-20250819.1.dist-info/RECORD +0 -464
- crc_pulpcore_client-20250819.1.dist-info/top_level.txt +0 -2
- services-pulpcore-client/__init__.py +0 -2
- services-pulpcore-client/api/__init__.py +0 -53
- services-pulpcore-client/api/access_policies_api.py +0 -1864
- services-pulpcore-client/api/artifacts_api.py +0 -1615
- services-pulpcore-client/api/content_api.py +0 -598
- services-pulpcore-client/api/content_openpgp_publickey_api.py +0 -1887
- services-pulpcore-client/api/content_openpgp_publicsubkey_api.py +0 -1518
- services-pulpcore-client/api/content_openpgp_signature_api.py +0 -1518
- services-pulpcore-client/api/content_openpgp_userattribute_api.py +0 -1518
- services-pulpcore-client/api/content_openpgp_userid_api.py +0 -1655
- services-pulpcore-client/api/contentguards_api.py +0 -667
- services-pulpcore-client/api/contentguards_composite_api.py +0 -3401
- services-pulpcore-client/api/contentguards_content_redirect_api.py +0 -3401
- services-pulpcore-client/api/contentguards_header_api.py +0 -3401
- services-pulpcore-client/api/contentguards_rbac_api.py +0 -3401
- services-pulpcore-client/api/distributions_api.py +0 -822
- services-pulpcore-client/api/distributions_artifacts_api.py +0 -1103
- services-pulpcore-client/api/distributions_openpgp_api.py +0 -2676
- services-pulpcore-client/api/domains_api.py +0 -3106
- services-pulpcore-client/api/exporters_filesystem_api.py +0 -2157
- services-pulpcore-client/api/exporters_filesystem_exports_api.py +0 -1288
- services-pulpcore-client/api/exporters_pulp_api.py +0 -2157
- services-pulpcore-client/api/exporters_pulp_exports_api.py +0 -1288
- services-pulpcore-client/api/groups_api.py +0 -3368
- services-pulpcore-client/api/groups_roles_api.py +0 -1496
- services-pulpcore-client/api/groups_users_api.py +0 -972
- services-pulpcore-client/api/importers_pulp_api.py +0 -2149
- services-pulpcore-client/api/importers_pulp_import_check_api.py +0 -350
- services-pulpcore-client/api/importers_pulp_imports_api.py +0 -1288
- services-pulpcore-client/api/livez_api.py +0 -329
- services-pulpcore-client/api/login_api.py +0 -897
- services-pulpcore-client/api/orphans_api.py +0 -319
- services-pulpcore-client/api/orphans_cleanup_api.py +0 -350
- services-pulpcore-client/api/publications_api.py +0 -765
- services-pulpcore-client/api/remotes_api.py +0 -850
- services-pulpcore-client/api/repair_api.py +0 -350
- services-pulpcore-client/api/repositories_api.py +0 -872
- services-pulpcore-client/api/repositories_openpgp_keyring_api.py +0 -4546
- services-pulpcore-client/api/repositories_reclaim_space_api.py +0 -350
- services-pulpcore-client/api/repository_versions_api.py +0 -764
- services-pulpcore-client/api/roles_api.py +0 -2269
- services-pulpcore-client/api/signing_services_api.py +0 -811
- services-pulpcore-client/api/status_api.py +0 -337
- services-pulpcore-client/api/task_groups_api.py +0 -1012
- services-pulpcore-client/api/task_schedules_api.py +0 -2114
- services-pulpcore-client/api/tasks_api.py +0 -4299
- services-pulpcore-client/api/uploads_api.py +0 -3346
- services-pulpcore-client/api/upstream_pulps_api.py +0 -4001
- services-pulpcore-client/api/users_api.py +0 -2373
- services-pulpcore-client/api/users_roles_api.py +0 -1496
- services-pulpcore-client/api/workers_api.py +0 -1148
- services-pulpcore-client/api_client.py +0 -798
- services-pulpcore-client/api_response.py +0 -21
- services-pulpcore-client/configuration.py +0 -628
- services-pulpcore-client/exceptions.py +0 -200
- services-pulpcore-client/models/__init__.py +0 -189
- services-pulpcore-client/models/access_policy.py +0 -94
- services-pulpcore-client/models/access_policy_response.py +0 -119
- services-pulpcore-client/models/api_app_status_response.py +0 -99
- services-pulpcore-client/models/artifact_distribution_response.py +0 -126
- services-pulpcore-client/models/artifact_response.py +0 -149
- services-pulpcore-client/models/async_operation_response.py +0 -88
- services-pulpcore-client/models/composite_content_guard.py +0 -98
- services-pulpcore-client/models/composite_content_guard_response.py +0 -114
- services-pulpcore-client/models/content_app_status_response.py +0 -99
- services-pulpcore-client/models/content_guard_response.py +0 -112
- services-pulpcore-client/models/content_redirect_content_guard.py +0 -96
- services-pulpcore-client/models/content_redirect_content_guard_response.py +0 -112
- services-pulpcore-client/models/content_settings_response.py +0 -95
- services-pulpcore-client/models/content_summary_response.py +0 -92
- services-pulpcore-client/models/database_connection_response.py +0 -88
- services-pulpcore-client/models/distribution_response.py +0 -133
- services-pulpcore-client/models/domain.py +0 -114
- services-pulpcore-client/models/domain_backend_migrator.py +0 -91
- services-pulpcore-client/models/domain_response.py +0 -131
- services-pulpcore-client/models/evaluation_response.py +0 -92
- services-pulpcore-client/models/filesystem_export.py +0 -99
- services-pulpcore-client/models/filesystem_export_response.py +0 -118
- services-pulpcore-client/models/filesystem_exporter.py +0 -94
- services-pulpcore-client/models/filesystem_exporter_response.py +0 -110
- services-pulpcore-client/models/generic_remote_response.py +0 -199
- services-pulpcore-client/models/generic_remote_response_hidden_fields_inner.py +0 -90
- services-pulpcore-client/models/generic_remote_response_policy_enum.py +0 -39
- services-pulpcore-client/models/group.py +0 -89
- services-pulpcore-client/models/group_progress_report_response.py +0 -111
- services-pulpcore-client/models/group_response.py +0 -101
- services-pulpcore-client/models/group_role.py +0 -110
- services-pulpcore-client/models/group_role_response.py +0 -134
- services-pulpcore-client/models/group_user.py +0 -89
- services-pulpcore-client/models/group_user_response.py +0 -97
- services-pulpcore-client/models/header_content_guard.py +0 -107
- services-pulpcore-client/models/header_content_guard_response.py +0 -123
- services-pulpcore-client/models/import_response.py +0 -107
- services-pulpcore-client/models/login_response.py +0 -98
- services-pulpcore-client/models/method_enum.py +0 -39
- services-pulpcore-client/models/minimal_task_response.py +0 -125
- services-pulpcore-client/models/multiple_artifact_content_response.py +0 -107
- services-pulpcore-client/models/my_permissions_response.py +0 -88
- services-pulpcore-client/models/nested_open_pgp_public_subkey.py +0 -92
- services-pulpcore-client/models/nested_open_pgp_public_subkey_response.py +0 -104
- services-pulpcore-client/models/nested_open_pgp_signature.py +0 -120
- services-pulpcore-client/models/nested_open_pgp_signature_response.py +0 -124
- services-pulpcore-client/models/nested_open_pgp_user_attribute.py +0 -89
- services-pulpcore-client/models/nested_open_pgp_user_attribute_response.py +0 -101
- services-pulpcore-client/models/nested_open_pgp_user_id.py +0 -89
- services-pulpcore-client/models/nested_open_pgp_user_id_response.py +0 -100
- services-pulpcore-client/models/nested_role.py +0 -93
- services-pulpcore-client/models/nested_role_response.py +0 -92
- services-pulpcore-client/models/object_roles_response.py +0 -96
- services-pulpcore-client/models/open_pgp_distribution.py +0 -116
- services-pulpcore-client/models/open_pgp_distribution_response.py +0 -140
- services-pulpcore-client/models/open_pgp_keyring.py +0 -112
- services-pulpcore-client/models/open_pgp_keyring_response.py +0 -137
- services-pulpcore-client/models/open_pgp_public_key_response.py +0 -150
- services-pulpcore-client/models/open_pgp_public_subkey_response.py +0 -126
- services-pulpcore-client/models/open_pgp_signature_response.py +0 -146
- services-pulpcore-client/models/open_pgp_user_attribute_response.py +0 -124
- services-pulpcore-client/models/open_pgp_user_id_response.py +0 -123
- services-pulpcore-client/models/orphans_cleanup.py +0 -96
- services-pulpcore-client/models/paginated_access_policy_response_list.py +0 -112
- services-pulpcore-client/models/paginated_artifact_distribution_response_list.py +0 -112
- services-pulpcore-client/models/paginated_artifact_response_list.py +0 -112
- services-pulpcore-client/models/paginated_composite_content_guard_response_list.py +0 -112
- services-pulpcore-client/models/paginated_content_guard_response_list.py +0 -112
- services-pulpcore-client/models/paginated_content_redirect_content_guard_response_list.py +0 -112
- services-pulpcore-client/models/paginated_distribution_response_list.py +0 -112
- services-pulpcore-client/models/paginated_domain_response_list.py +0 -112
- services-pulpcore-client/models/paginated_filesystem_export_response_list.py +0 -112
- services-pulpcore-client/models/paginated_filesystem_exporter_response_list.py +0 -112
- services-pulpcore-client/models/paginated_generic_remote_response_list.py +0 -112
- services-pulpcore-client/models/paginated_group_response_list.py +0 -112
- services-pulpcore-client/models/paginated_group_role_response_list.py +0 -112
- services-pulpcore-client/models/paginated_group_user_response_list.py +0 -112
- services-pulpcore-client/models/paginated_header_content_guard_response_list.py +0 -112
- services-pulpcore-client/models/paginated_import_response_list.py +0 -112
- services-pulpcore-client/models/paginated_multiple_artifact_content_response_list.py +0 -112
- services-pulpcore-client/models/paginated_open_pgp_distribution_response_list.py +0 -112
- services-pulpcore-client/models/paginated_open_pgp_keyring_response_list.py +0 -112
- services-pulpcore-client/models/paginated_open_pgp_public_key_response_list.py +0 -112
- services-pulpcore-client/models/paginated_open_pgp_public_subkey_response_list.py +0 -112
- services-pulpcore-client/models/paginated_open_pgp_signature_response_list.py +0 -112
- services-pulpcore-client/models/paginated_open_pgp_user_attribute_response_list.py +0 -112
- services-pulpcore-client/models/paginated_open_pgp_user_id_response_list.py +0 -112
- services-pulpcore-client/models/paginated_publication_response_list.py +0 -112
- services-pulpcore-client/models/paginated_pulp_export_response_list.py +0 -112
- services-pulpcore-client/models/paginated_pulp_exporter_response_list.py +0 -112
- services-pulpcore-client/models/paginated_pulp_importer_response_list.py +0 -112
- services-pulpcore-client/models/paginated_rbac_content_guard_response_list.py +0 -112
- services-pulpcore-client/models/paginated_repository_response_list.py +0 -112
- services-pulpcore-client/models/paginated_repository_version_response_list.py +0 -112
- services-pulpcore-client/models/paginated_role_response_list.py +0 -112
- services-pulpcore-client/models/paginated_signing_service_response_list.py +0 -112
- services-pulpcore-client/models/paginated_task_group_response_list.py +0 -112
- services-pulpcore-client/models/paginated_task_response_list.py +0 -112
- services-pulpcore-client/models/paginated_task_schedule_response_list.py +0 -112
- services-pulpcore-client/models/paginated_upload_response_list.py +0 -112
- services-pulpcore-client/models/paginated_upstream_pulp_response_list.py +0 -112
- services-pulpcore-client/models/paginated_user_response_list.py +0 -112
- services-pulpcore-client/models/paginated_user_role_response_list.py +0 -112
- services-pulpcore-client/models/paginated_worker_response_list.py +0 -112
- services-pulpcore-client/models/patched_access_policy.py +0 -94
- services-pulpcore-client/models/patched_composite_content_guard.py +0 -98
- services-pulpcore-client/models/patched_content_redirect_content_guard.py +0 -96
- services-pulpcore-client/models/patched_domain.py +0 -117
- services-pulpcore-client/models/patched_filesystem_exporter.py +0 -94
- services-pulpcore-client/models/patched_group.py +0 -89
- services-pulpcore-client/models/patched_header_content_guard.py +0 -107
- services-pulpcore-client/models/patched_open_pgp_distribution.py +0 -116
- services-pulpcore-client/models/patched_open_pgp_keyring.py +0 -112
- services-pulpcore-client/models/patched_pulp_exporter.py +0 -100
- services-pulpcore-client/models/patched_pulp_importer.py +0 -91
- services-pulpcore-client/models/patched_rbac_content_guard.py +0 -96
- services-pulpcore-client/models/patched_role.py +0 -98
- services-pulpcore-client/models/patched_task_cancel.py +0 -89
- services-pulpcore-client/models/patched_upstream_pulp.py +0 -147
- services-pulpcore-client/models/patched_user.py +0 -106
- services-pulpcore-client/models/policy357_enum.py +0 -39
- services-pulpcore-client/models/profile_artifact_response.py +0 -88
- services-pulpcore-client/models/progress_report_response.py +0 -115
- services-pulpcore-client/models/publication_response.py +0 -107
- services-pulpcore-client/models/pulp_export.py +0 -104
- services-pulpcore-client/models/pulp_export_response.py +0 -126
- services-pulpcore-client/models/pulp_exporter.py +0 -100
- services-pulpcore-client/models/pulp_exporter_response.py +0 -116
- services-pulpcore-client/models/pulp_import.py +0 -93
- services-pulpcore-client/models/pulp_import_check.py +0 -93
- services-pulpcore-client/models/pulp_import_check_response.py +0 -102
- services-pulpcore-client/models/pulp_importer.py +0 -91
- services-pulpcore-client/models/pulp_importer_response.py +0 -107
- services-pulpcore-client/models/purge.py +0 -92
- services-pulpcore-client/models/rbac_content_guard.py +0 -96
- services-pulpcore-client/models/rbac_content_guard_response.py +0 -136
- services-pulpcore-client/models/reclaim_space.py +0 -90
- services-pulpcore-client/models/redis_connection_response.py +0 -88
- services-pulpcore-client/models/repair.py +0 -88
- services-pulpcore-client/models/repository_add_remove_content.py +0 -93
- services-pulpcore-client/models/repository_response.py +0 -137
- services-pulpcore-client/models/repository_version_response.py +0 -121
- services-pulpcore-client/models/role.py +0 -98
- services-pulpcore-client/models/role_response.py +0 -118
- services-pulpcore-client/models/set_label.py +0 -103
- services-pulpcore-client/models/set_label_response.py +0 -103
- services-pulpcore-client/models/signing_service_response.py +0 -111
- services-pulpcore-client/models/states_enum.py +0 -40
- services-pulpcore-client/models/status_response.py +0 -152
- services-pulpcore-client/models/storage_class_enum.py +0 -40
- services-pulpcore-client/models/storage_response.py +0 -108
- services-pulpcore-client/models/task_group_operation_response.py +0 -88
- services-pulpcore-client/models/task_group_response.py +0 -150
- services-pulpcore-client/models/task_response.py +0 -167
- services-pulpcore-client/models/task_schedule_response.py +0 -127
- services-pulpcore-client/models/unset_label.py +0 -96
- services-pulpcore-client/models/unset_label_response.py +0 -100
- services-pulpcore-client/models/upload.py +0 -88
- services-pulpcore-client/models/upload_chunk_response.py +0 -94
- services-pulpcore-client/models/upload_commit.py +0 -89
- services-pulpcore-client/models/upload_detail_response.py +0 -121
- services-pulpcore-client/models/upload_response.py +0 -109
- services-pulpcore-client/models/upstream_pulp.py +0 -147
- services-pulpcore-client/models/upstream_pulp_response.py +0 -158
- services-pulpcore-client/models/user.py +0 -106
- services-pulpcore-client/models/user_group.py +0 -89
- services-pulpcore-client/models/user_group_response.py +0 -97
- services-pulpcore-client/models/user_response.py +0 -140
- services-pulpcore-client/models/user_role.py +0 -110
- services-pulpcore-client/models/user_role_response.py +0 -134
- services-pulpcore-client/models/version_response.py +0 -96
- services-pulpcore-client/models/worker_response.py +0 -119
- services-pulpcore-client/py.typed +0 -0
- services-pulpcore-client/rest.py +0 -258
- {crc_pulpcore_client-20250819.1.dist-info → crc_pulpcore_client-20250820.1.dist-info}/WHEEL +0 -0
|
@@ -1,107 +0,0 @@
|
|
|
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 PatchedHeaderContentGuard(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
A serializer for HeaderContentGuard.
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique name.")
|
|
32
|
-
description: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="An optional description.")
|
|
33
|
-
header_name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The header name the guard will check on.")
|
|
34
|
-
header_value: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The value that will authorize the request.")
|
|
35
|
-
jq_filter: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A JQ syntax compatible filter. If jq_filter is not set, then the value willonly be Base64 decoded and checked as an explicit string match.")
|
|
36
|
-
__properties: ClassVar[List[str]] = ["name", "description", "header_name", "header_value", "jq_filter"]
|
|
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 PatchedHeaderContentGuard 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 description (nullable) is None
|
|
78
|
-
# and model_fields_set contains the field
|
|
79
|
-
if self.description is None and "description" in self.model_fields_set:
|
|
80
|
-
_dict['description'] = None
|
|
81
|
-
|
|
82
|
-
# set to None if jq_filter (nullable) is None
|
|
83
|
-
# and model_fields_set contains the field
|
|
84
|
-
if self.jq_filter is None and "jq_filter" in self.model_fields_set:
|
|
85
|
-
_dict['jq_filter'] = None
|
|
86
|
-
|
|
87
|
-
return _dict
|
|
88
|
-
|
|
89
|
-
@classmethod
|
|
90
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
-
"""Create an instance of PatchedHeaderContentGuard from a dict"""
|
|
92
|
-
if obj is None:
|
|
93
|
-
return None
|
|
94
|
-
|
|
95
|
-
if not isinstance(obj, dict):
|
|
96
|
-
return cls.model_validate(obj)
|
|
97
|
-
|
|
98
|
-
_obj = cls.model_validate({
|
|
99
|
-
"name": obj.get("name"),
|
|
100
|
-
"description": obj.get("description"),
|
|
101
|
-
"header_name": obj.get("header_name"),
|
|
102
|
-
"header_value": obj.get("header_value"),
|
|
103
|
-
"jq_filter": obj.get("jq_filter")
|
|
104
|
-
})
|
|
105
|
-
return _obj
|
|
106
|
-
|
|
107
|
-
|
|
@@ -1,116 +0,0 @@
|
|
|
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 PatchedOpenPGPDistribution(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
The Serializer for the Distribution model. The serializer deliberately omits the `publication` and `repository_version` field due to plugins typically requiring one or the other but not both. To include the ``publication`` field, it is recommended plugins define the field:: publication = DetailRelatedField( required=False, help_text=_(\"Publication to be served\"), view_name_pattern=r\"publications(-.*/.*)?-detail\", queryset=models.Publication.objects.exclude(complete=False), allow_null=True, ) To include the ``repository_version`` field, it is recommended plugins define the field:: repository_version = RepositoryVersionRelatedField( required=False, help_text=_(\"RepositoryVersion to be served\"), allow_null=True ) Additionally, the serializer omits the ``remote`` field, which is used for pull-through caching feature and only by plugins which use publications. Plugins implementing a pull-through caching should define the field in their derived serializer class like this:: remote = DetailRelatedField( required=False, help_text=_('Remote that can be used to fetch content when using pull-through caching.'), queryset=models.Remote.objects.all(), allow_null=True )
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
base_path: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")")
|
|
32
|
-
content_guard: Optional[StrictStr] = Field(default=None, description="An optional content-guard.")
|
|
33
|
-
hidden: Optional[StrictBool] = Field(default=False, description="Whether this distribution should be shown in the content app.")
|
|
34
|
-
pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
|
|
35
|
-
name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A unique name. Ex, `rawhide` and `stable`.")
|
|
36
|
-
repository: Optional[StrictStr] = Field(default=None, description="The latest RepositoryVersion for this Repository will be served.")
|
|
37
|
-
repository_version: Optional[StrictStr] = Field(default=None, description="RepositoryVersion to be served")
|
|
38
|
-
__properties: ClassVar[List[str]] = ["base_path", "content_guard", "hidden", "pulp_labels", "name", "repository", "repository_version"]
|
|
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 PatchedOpenPGPDistribution 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 content_guard (nullable) is None
|
|
80
|
-
# and model_fields_set contains the field
|
|
81
|
-
if self.content_guard is None and "content_guard" in self.model_fields_set:
|
|
82
|
-
_dict['content_guard'] = None
|
|
83
|
-
|
|
84
|
-
# set to None if repository (nullable) is None
|
|
85
|
-
# and model_fields_set contains the field
|
|
86
|
-
if self.repository is None and "repository" in self.model_fields_set:
|
|
87
|
-
_dict['repository'] = None
|
|
88
|
-
|
|
89
|
-
# set to None if repository_version (nullable) is None
|
|
90
|
-
# and model_fields_set contains the field
|
|
91
|
-
if self.repository_version is None and "repository_version" in self.model_fields_set:
|
|
92
|
-
_dict['repository_version'] = None
|
|
93
|
-
|
|
94
|
-
return _dict
|
|
95
|
-
|
|
96
|
-
@classmethod
|
|
97
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
-
"""Create an instance of PatchedOpenPGPDistribution from a dict"""
|
|
99
|
-
if obj is None:
|
|
100
|
-
return None
|
|
101
|
-
|
|
102
|
-
if not isinstance(obj, dict):
|
|
103
|
-
return cls.model_validate(obj)
|
|
104
|
-
|
|
105
|
-
_obj = cls.model_validate({
|
|
106
|
-
"base_path": obj.get("base_path"),
|
|
107
|
-
"content_guard": obj.get("content_guard"),
|
|
108
|
-
"hidden": obj.get("hidden") if obj.get("hidden") is not None else False,
|
|
109
|
-
"pulp_labels": obj.get("pulp_labels"),
|
|
110
|
-
"name": obj.get("name"),
|
|
111
|
-
"repository": obj.get("repository"),
|
|
112
|
-
"repository_version": obj.get("repository_version")
|
|
113
|
-
})
|
|
114
|
-
return _obj
|
|
115
|
-
|
|
116
|
-
|
|
@@ -1,112 +0,0 @@
|
|
|
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, Optional
|
|
23
|
-
from typing_extensions import Annotated
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class PatchedOpenPGPKeyring(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
|
|
32
|
-
name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, 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
|
-
__properties: ClassVar[List[str]] = ["pulp_labels", "name", "description", "retain_repo_versions", "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 PatchedOpenPGPKeyring 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 description (nullable) is None
|
|
78
|
-
# and model_fields_set contains the field
|
|
79
|
-
if self.description is None and "description" in self.model_fields_set:
|
|
80
|
-
_dict['description'] = None
|
|
81
|
-
|
|
82
|
-
# set to None if retain_repo_versions (nullable) is None
|
|
83
|
-
# and model_fields_set contains the field
|
|
84
|
-
if self.retain_repo_versions is None and "retain_repo_versions" in self.model_fields_set:
|
|
85
|
-
_dict['retain_repo_versions'] = None
|
|
86
|
-
|
|
87
|
-
# set to None if remote (nullable) is None
|
|
88
|
-
# and model_fields_set contains the field
|
|
89
|
-
if self.remote is None and "remote" in self.model_fields_set:
|
|
90
|
-
_dict['remote'] = None
|
|
91
|
-
|
|
92
|
-
return _dict
|
|
93
|
-
|
|
94
|
-
@classmethod
|
|
95
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
96
|
-
"""Create an instance of PatchedOpenPGPKeyring from a dict"""
|
|
97
|
-
if obj is None:
|
|
98
|
-
return None
|
|
99
|
-
|
|
100
|
-
if not isinstance(obj, dict):
|
|
101
|
-
return cls.model_validate(obj)
|
|
102
|
-
|
|
103
|
-
_obj = cls.model_validate({
|
|
104
|
-
"pulp_labels": obj.get("pulp_labels"),
|
|
105
|
-
"name": obj.get("name"),
|
|
106
|
-
"description": obj.get("description"),
|
|
107
|
-
"retain_repo_versions": obj.get("retain_repo_versions"),
|
|
108
|
-
"remote": obj.get("remote")
|
|
109
|
-
})
|
|
110
|
-
return _obj
|
|
111
|
-
|
|
112
|
-
|
|
@@ -1,100 +0,0 @@
|
|
|
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, Optional
|
|
23
|
-
from typing_extensions import Annotated
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class PatchedPulpExporter(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
Serializer for pulp exporters.
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Unique name of the file system exporter.")
|
|
32
|
-
path: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="File system directory to store exported tar.gzs.")
|
|
33
|
-
repositories: Optional[List[StrictStr]] = None
|
|
34
|
-
last_export: Optional[StrictStr] = Field(default=None, description="Last attempted export for this PulpExporter")
|
|
35
|
-
__properties: ClassVar[List[str]] = ["name", "path", "repositories", "last_export"]
|
|
36
|
-
|
|
37
|
-
model_config = ConfigDict(
|
|
38
|
-
populate_by_name=True,
|
|
39
|
-
validate_assignment=True,
|
|
40
|
-
protected_namespaces=(),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def to_str(self) -> str:
|
|
45
|
-
"""Returns the string representation of the model using alias"""
|
|
46
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
-
|
|
48
|
-
def to_json(self) -> str:
|
|
49
|
-
"""Returns the JSON representation of the model using alias"""
|
|
50
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
-
return json.dumps(self.to_dict())
|
|
52
|
-
|
|
53
|
-
@classmethod
|
|
54
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
-
"""Create an instance of PatchedPulpExporter from a JSON string"""
|
|
56
|
-
return cls.from_dict(json.loads(json_str))
|
|
57
|
-
|
|
58
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
-
"""Return the dictionary representation of the model using alias.
|
|
60
|
-
|
|
61
|
-
This has the following differences from calling pydantic's
|
|
62
|
-
`self.model_dump(by_alias=True)`:
|
|
63
|
-
|
|
64
|
-
* `None` is only added to the output dict for nullable fields that
|
|
65
|
-
were set at model initialization. Other fields with value `None`
|
|
66
|
-
are ignored.
|
|
67
|
-
"""
|
|
68
|
-
excluded_fields: Set[str] = set([
|
|
69
|
-
])
|
|
70
|
-
|
|
71
|
-
_dict = self.model_dump(
|
|
72
|
-
by_alias=True,
|
|
73
|
-
exclude=excluded_fields,
|
|
74
|
-
exclude_none=True,
|
|
75
|
-
)
|
|
76
|
-
# set to None if last_export (nullable) is None
|
|
77
|
-
# and model_fields_set contains the field
|
|
78
|
-
if self.last_export is None and "last_export" in self.model_fields_set:
|
|
79
|
-
_dict['last_export'] = None
|
|
80
|
-
|
|
81
|
-
return _dict
|
|
82
|
-
|
|
83
|
-
@classmethod
|
|
84
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
-
"""Create an instance of PatchedPulpExporter from a dict"""
|
|
86
|
-
if obj is None:
|
|
87
|
-
return None
|
|
88
|
-
|
|
89
|
-
if not isinstance(obj, dict):
|
|
90
|
-
return cls.model_validate(obj)
|
|
91
|
-
|
|
92
|
-
_obj = cls.model_validate({
|
|
93
|
-
"name": obj.get("name"),
|
|
94
|
-
"path": obj.get("path"),
|
|
95
|
-
"repositories": obj.get("repositories"),
|
|
96
|
-
"last_export": obj.get("last_export")
|
|
97
|
-
})
|
|
98
|
-
return _obj
|
|
99
|
-
|
|
100
|
-
|
|
@@ -1,91 +0,0 @@
|
|
|
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 PatchedPulpImporter(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
Serializer for PulpImporters.
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Unique name of the Importer.")
|
|
32
|
-
repo_mapping: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = Field(default=None, description="Mapping of repo names in an export file to the repo names in Pulp. For example, if the export has a repo named 'foo' and the repo to import content into was 'bar', the mapping would be \"{'foo': 'bar'}\".")
|
|
33
|
-
__properties: ClassVar[List[str]] = ["name", "repo_mapping"]
|
|
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 PatchedPulpImporter 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 PatchedPulpImporter 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
|
-
"name": obj.get("name"),
|
|
87
|
-
"repo_mapping": obj.get("repo_mapping")
|
|
88
|
-
})
|
|
89
|
-
return _obj
|
|
90
|
-
|
|
91
|
-
|
|
@@ -1,96 +0,0 @@
|
|
|
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 PatchedRBACContentGuard(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
Base class for content guard serializers.
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The unique name.")
|
|
32
|
-
description: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="An optional description.")
|
|
33
|
-
__properties: ClassVar[List[str]] = ["name", "description"]
|
|
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 PatchedRBACContentGuard 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
|
-
# set to None if description (nullable) is None
|
|
75
|
-
# and model_fields_set contains the field
|
|
76
|
-
if self.description is None and "description" in self.model_fields_set:
|
|
77
|
-
_dict['description'] = None
|
|
78
|
-
|
|
79
|
-
return _dict
|
|
80
|
-
|
|
81
|
-
@classmethod
|
|
82
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
-
"""Create an instance of PatchedRBACContentGuard from a dict"""
|
|
84
|
-
if obj is None:
|
|
85
|
-
return None
|
|
86
|
-
|
|
87
|
-
if not isinstance(obj, dict):
|
|
88
|
-
return cls.model_validate(obj)
|
|
89
|
-
|
|
90
|
-
_obj = cls.model_validate({
|
|
91
|
-
"name": obj.get("name"),
|
|
92
|
-
"description": obj.get("description")
|
|
93
|
-
})
|
|
94
|
-
return _obj
|
|
95
|
-
|
|
96
|
-
|