pulp-python-client 3.12.4__py3-none-any.whl → 3.13.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pulp-python-client might be problematic. Click here for more details.
- pulp_python_client-3.13.0.dist-info/METADATA +17 -0
- pulp_python_client-3.13.0.dist-info/RECORD +64 -0
- {pulp_python_client-3.12.4.dist-info → pulp_python_client-3.13.0.dist-info}/WHEEL +1 -1
- pulpcore/client/pulp_python/__init__.py +9 -10
- pulpcore/client/pulp_python/api/__init__.py +1 -2
- pulpcore/client/pulp_python/api/content_packages_api.py +1800 -655
- pulpcore/client/pulp_python/api/distributions_pypi_api.py +3755 -1474
- pulpcore/client/pulp_python/api/publications_pypi_api.py +2574 -982
- pulpcore/client/pulp_python/api/pypi_api.py +302 -128
- pulpcore/client/pulp_python/api/pypi_legacy_api.py +326 -153
- pulpcore/client/pulp_python/api/pypi_metadata_api.py +319 -139
- pulpcore/client/pulp_python/api/pypi_simple_api.py +899 -382
- pulpcore/client/pulp_python/api/remotes_python_api.py +4092 -1589
- pulpcore/client/pulp_python/api/repositories_python_api.py +4380 -1719
- pulpcore/client/pulp_python/api/repositories_python_versions_api.py +1526 -561
- pulpcore/client/pulp_python/api_client.py +444 -313
- pulpcore/client/pulp_python/api_response.py +21 -0
- pulpcore/client/pulp_python/configuration.py +266 -73
- pulpcore/client/pulp_python/exceptions.py +99 -20
- pulpcore/client/pulp_python/models/__init__.py +5 -8
- pulpcore/client/pulp_python/models/async_operation_response.py +60 -96
- pulpcore/client/pulp_python/models/content_summary_response.py +70 -154
- pulpcore/client/pulp_python/models/exclude_platforms_enum.py +19 -82
- pulpcore/client/pulp_python/models/my_permissions_response.py +60 -94
- pulpcore/client/pulp_python/models/nested_role.py +71 -155
- pulpcore/client/pulp_python/models/nested_role_response.py +70 -152
- pulpcore/client/pulp_python/models/object_roles_response.py +70 -96
- pulpcore/client/pulp_python/models/package_metadata_response.py +91 -191
- pulpcore/client/pulp_python/models/package_types_enum.py +23 -86
- pulpcore/client/pulp_python/models/package_upload_task_response.py +85 -154
- pulpcore/client/pulp_python/models/paginated_repository_version_response_list.py +94 -181
- pulpcore/client/pulp_python/models/paginatedpython_python_distribution_response_list.py +94 -181
- pulpcore/client/pulp_python/models/paginatedpython_python_package_content_response_list.py +94 -181
- pulpcore/client/pulp_python/models/paginatedpython_python_publication_response_list.py +94 -181
- pulpcore/client/pulp_python/models/paginatedpython_python_remote_response_list.py +94 -181
- pulpcore/client/pulp_python/models/paginatedpython_python_repository_response_list.py +94 -181
- pulpcore/client/pulp_python/models/patchedpython_python_distribution.py +108 -330
- pulpcore/client/pulp_python/models/patchedpython_python_remote.py +204 -864
- pulpcore/client/pulp_python/models/patchedpython_python_repository.py +96 -249
- pulpcore/client/pulp_python/models/policy_enum.py +18 -81
- pulpcore/client/pulp_python/models/python_python_distribution.py +108 -332
- pulpcore/client/pulp_python/models/python_python_distribution_response.py +132 -490
- pulpcore/client/pulp_python/models/python_python_package_content_response.py +182 -972
- pulpcore/client/pulp_python/models/python_python_publication.py +68 -127
- pulpcore/client/pulp_python/models/python_python_publication_response.py +93 -269
- pulpcore/client/pulp_python/models/python_python_remote.py +204 -866
- pulpcore/client/pulp_python/models/python_python_remote_response.py +198 -839
- pulpcore/client/pulp_python/models/python_python_remote_response_hidden_fields_inner.py +90 -0
- pulpcore/client/pulp_python/models/python_python_repository.py +96 -250
- pulpcore/client/pulp_python/models/python_python_repository_response.py +122 -407
- pulpcore/client/pulp_python/models/repair.py +60 -95
- pulpcore/client/pulp_python/models/repository_add_remove_content.py +71 -157
- pulpcore/client/pulp_python/models/repository_sync_url.py +68 -129
- pulpcore/client/pulp_python/models/repository_version_response.py +104 -296
- pulpcore/client/pulp_python/models/set_label.py +80 -130
- pulpcore/client/pulp_python/models/set_label_response.py +80 -127
- pulpcore/client/pulp_python/models/summary_response.py +70 -160
- pulpcore/client/pulp_python/models/unset_label.py +75 -107
- pulpcore/client/pulp_python/models/unset_label_response.py +78 -129
- pulpcore/client/pulp_python/py.typed +0 -0
- pulpcore/client/pulp_python/rest.py +136 -170
- pulp_python_client-3.12.4.dist-info/METADATA +0 -17
- pulp_python_client-3.12.4.dist-info/RECORD +0 -65
- pulpcore/client/pulp_python/models/package_upload.py +0 -190
- pulpcore/client/pulp_python/models/python_bander_remote.py +0 -184
- pulpcore/client/pulp_python/models/python_python_package_content.py +0 -889
- pulpcore/client/pulp_python/models/python_python_remote_response_hidden_fields.py +0 -149
- {pulp_python_client-3.12.4.dist-info → pulp_python_client-3.13.0.dist-info}/top_level.txt +0 -0
|
@@ -3,101 +3,38 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Pulp 3 API
|
|
5
5
|
|
|
6
|
-
Fetch, Upload, Organize, and Distribute Software Packages
|
|
6
|
+
Fetch, Upload, Organize, and Distribute Software Packages
|
|
7
7
|
|
|
8
8
|
The version of the OpenAPI document: v3
|
|
9
9
|
Contact: pulp-list@redhat.com
|
|
10
|
-
Generated by
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import pprint
|
|
15
|
-
import re # noqa: F401
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
16
11
|
|
|
17
|
-
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
18
14
|
|
|
19
|
-
from pulpcore.client.pulp_python.configuration import Configuration
|
|
20
15
|
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
21
20
|
|
|
22
|
-
class ExcludePlatformsEnum(object):
|
|
23
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
|
24
|
-
Ref: https://openapi-generator.tech
|
|
25
21
|
|
|
26
|
-
|
|
22
|
+
class ExcludePlatformsEnum(str, Enum):
|
|
27
23
|
"""
|
|
28
|
-
|
|
29
|
-
"""
|
|
30
|
-
allowed enum values
|
|
24
|
+
* `windows` - windows * `macos` - macos * `freebsd` - freebsd * `linux` - linux
|
|
31
25
|
"""
|
|
32
|
-
WINDOWS = "windows"
|
|
33
|
-
MACOS = "macos"
|
|
34
|
-
FREEBSD = "freebsd"
|
|
35
|
-
LINUX = "linux"
|
|
36
|
-
|
|
37
|
-
allowable_values = [WINDOWS, MACOS, FREEBSD, LINUX] # noqa: E501
|
|
38
26
|
|
|
39
27
|
"""
|
|
40
|
-
|
|
41
|
-
openapi_types (dict): The key is attribute name
|
|
42
|
-
and the value is attribute type.
|
|
43
|
-
attribute_map (dict): The key is attribute name
|
|
44
|
-
and the value is json key in definition.
|
|
28
|
+
allowed enum values
|
|
45
29
|
"""
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
def __init__(self, local_vars_configuration=None): # noqa: E501
|
|
53
|
-
"""ExcludePlatformsEnum - a model defined in OpenAPI""" # noqa: E501
|
|
54
|
-
if local_vars_configuration is None:
|
|
55
|
-
local_vars_configuration = Configuration()
|
|
56
|
-
self.local_vars_configuration = local_vars_configuration
|
|
57
|
-
self.discriminator = None
|
|
58
|
-
|
|
59
|
-
def to_dict(self):
|
|
60
|
-
"""Returns the model properties as a dict"""
|
|
61
|
-
result = {}
|
|
62
|
-
|
|
63
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
64
|
-
value = getattr(self, attr)
|
|
65
|
-
if isinstance(value, list):
|
|
66
|
-
result[attr] = list(map(
|
|
67
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
68
|
-
value
|
|
69
|
-
))
|
|
70
|
-
elif hasattr(value, "to_dict"):
|
|
71
|
-
result[attr] = value.to_dict()
|
|
72
|
-
elif isinstance(value, dict):
|
|
73
|
-
result[attr] = dict(map(
|
|
74
|
-
lambda item: (item[0], item[1].to_dict())
|
|
75
|
-
if hasattr(item[1], "to_dict") else item,
|
|
76
|
-
value.items()
|
|
77
|
-
))
|
|
78
|
-
else:
|
|
79
|
-
result[attr] = value
|
|
80
|
-
|
|
81
|
-
return result
|
|
82
|
-
|
|
83
|
-
def to_str(self):
|
|
84
|
-
"""Returns the string representation of the model"""
|
|
85
|
-
return pprint.pformat(self.to_dict())
|
|
86
|
-
|
|
87
|
-
def __repr__(self):
|
|
88
|
-
"""For `print` and `pprint`"""
|
|
89
|
-
return self.to_str()
|
|
90
|
-
|
|
91
|
-
def __eq__(self, other):
|
|
92
|
-
"""Returns true if both objects are equal"""
|
|
93
|
-
if not isinstance(other, ExcludePlatformsEnum):
|
|
94
|
-
return False
|
|
30
|
+
WINDOWS = 'windows'
|
|
31
|
+
MACOS = 'macos'
|
|
32
|
+
FREEBSD = 'freebsd'
|
|
33
|
+
LINUX = 'linux'
|
|
95
34
|
|
|
96
|
-
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
|
37
|
+
"""Create an instance of ExcludePlatformsEnum from a JSON string"""
|
|
38
|
+
return cls(json.loads(json_str))
|
|
97
39
|
|
|
98
|
-
def __ne__(self, other):
|
|
99
|
-
"""Returns true if both objects are not equal"""
|
|
100
|
-
if not isinstance(other, ExcludePlatformsEnum):
|
|
101
|
-
return True
|
|
102
40
|
|
|
103
|
-
return self.to_dict() != other.to_dict()
|
|
@@ -3,120 +3,86 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Pulp 3 API
|
|
5
5
|
|
|
6
|
-
Fetch, Upload, Organize, and Distribute Software Packages
|
|
6
|
+
Fetch, Upload, Organize, and Distribute Software Packages
|
|
7
7
|
|
|
8
8
|
The version of the OpenAPI document: v3
|
|
9
9
|
Contact: pulp-list@redhat.com
|
|
10
|
-
Generated by
|
|
11
|
-
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
12
14
|
|
|
13
15
|
|
|
16
|
+
from __future__ import annotations
|
|
14
17
|
import pprint
|
|
15
18
|
import re # noqa: F401
|
|
19
|
+
import json
|
|
16
20
|
|
|
17
|
-
import
|
|
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
|
|
18
25
|
|
|
19
|
-
|
|
26
|
+
class MyPermissionsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
MyPermissionsResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
permissions: List[StrictStr]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["permissions"]
|
|
20
32
|
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
21
38
|
|
|
22
|
-
class MyPermissionsResponse(object):
|
|
23
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
|
24
|
-
Ref: https://openapi-generator.tech
|
|
25
39
|
|
|
26
|
-
|
|
27
|
-
|
|
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))
|
|
28
43
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
attribute_map (dict): The key is attribute name
|
|
34
|
-
and the value is json key in definition.
|
|
35
|
-
"""
|
|
36
|
-
openapi_types = {
|
|
37
|
-
'permissions': 'list[str]'
|
|
38
|
-
}
|
|
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())
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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))
|
|
43
53
|
|
|
44
|
-
def
|
|
45
|
-
"""
|
|
46
|
-
if local_vars_configuration is None:
|
|
47
|
-
local_vars_configuration = Configuration()
|
|
48
|
-
self.local_vars_configuration = local_vars_configuration
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
self.
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
52
59
|
|
|
53
|
-
|
|
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
|
+
])
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
58
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
|
|
59
79
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"""
|
|
63
|
-
return self._permissions
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
64
82
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"permissions": obj.get("permissions")
|
|
85
|
+
})
|
|
86
|
+
return _obj
|
|
68
87
|
|
|
69
88
|
|
|
70
|
-
:param permissions: The permissions of this MyPermissionsResponse. # noqa: E501
|
|
71
|
-
:type: list[str]
|
|
72
|
-
"""
|
|
73
|
-
if self.local_vars_configuration.client_side_validation and permissions is None: # noqa: E501
|
|
74
|
-
raise ValueError("Invalid value for `permissions`, must not be `None`") # noqa: E501
|
|
75
|
-
|
|
76
|
-
self._permissions = permissions
|
|
77
|
-
|
|
78
|
-
def to_dict(self):
|
|
79
|
-
"""Returns the model properties as a dict"""
|
|
80
|
-
result = {}
|
|
81
|
-
|
|
82
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
83
|
-
value = getattr(self, attr)
|
|
84
|
-
if isinstance(value, list):
|
|
85
|
-
result[attr] = list(map(
|
|
86
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
87
|
-
value
|
|
88
|
-
))
|
|
89
|
-
elif hasattr(value, "to_dict"):
|
|
90
|
-
result[attr] = value.to_dict()
|
|
91
|
-
elif isinstance(value, dict):
|
|
92
|
-
result[attr] = dict(map(
|
|
93
|
-
lambda item: (item[0], item[1].to_dict())
|
|
94
|
-
if hasattr(item[1], "to_dict") else item,
|
|
95
|
-
value.items()
|
|
96
|
-
))
|
|
97
|
-
else:
|
|
98
|
-
result[attr] = value
|
|
99
|
-
|
|
100
|
-
return result
|
|
101
|
-
|
|
102
|
-
def to_str(self):
|
|
103
|
-
"""Returns the string representation of the model"""
|
|
104
|
-
return pprint.pformat(self.to_dict())
|
|
105
|
-
|
|
106
|
-
def __repr__(self):
|
|
107
|
-
"""For `print` and `pprint`"""
|
|
108
|
-
return self.to_str()
|
|
109
|
-
|
|
110
|
-
def __eq__(self, other):
|
|
111
|
-
"""Returns true if both objects are equal"""
|
|
112
|
-
if not isinstance(other, MyPermissionsResponse):
|
|
113
|
-
return False
|
|
114
|
-
|
|
115
|
-
return self.to_dict() == other.to_dict()
|
|
116
|
-
|
|
117
|
-
def __ne__(self, other):
|
|
118
|
-
"""Returns true if both objects are not equal"""
|
|
119
|
-
if not isinstance(other, MyPermissionsResponse):
|
|
120
|
-
return True
|
|
121
|
-
|
|
122
|
-
return self.to_dict() != other.to_dict()
|
|
@@ -3,175 +3,91 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Pulp 3 API
|
|
5
5
|
|
|
6
|
-
Fetch, Upload, Organize, and Distribute Software Packages
|
|
6
|
+
Fetch, Upload, Organize, and Distribute Software Packages
|
|
7
7
|
|
|
8
8
|
The version of the OpenAPI document: v3
|
|
9
9
|
Contact: pulp-list@redhat.com
|
|
10
|
-
Generated by
|
|
11
|
-
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
12
14
|
|
|
13
15
|
|
|
16
|
+
from __future__ import annotations
|
|
14
17
|
import pprint
|
|
15
18
|
import re # noqa: F401
|
|
19
|
+
import json
|
|
16
20
|
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
from
|
|
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
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
class NestedRole(object):
|
|
23
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
|
24
|
-
Ref: https://openapi-generator.tech
|
|
25
|
-
|
|
26
|
-
Do not edit the class manually.
|
|
27
|
+
class NestedRole(BaseModel):
|
|
27
28
|
"""
|
|
28
|
-
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
@property
|
|
66
|
-
def users(self):
|
|
67
|
-
"""Gets the users of this NestedRole. # noqa: E501
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
:return: The users of this NestedRole. # noqa: E501
|
|
71
|
-
:rtype: list[str]
|
|
72
|
-
"""
|
|
73
|
-
return self._users
|
|
74
|
-
|
|
75
|
-
@users.setter
|
|
76
|
-
def users(self, users):
|
|
77
|
-
"""Sets the users of this NestedRole.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
:param users: The users of this NestedRole. # noqa: E501
|
|
81
|
-
:type: list[str]
|
|
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.
|
|
82
66
|
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
83
69
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
89
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
|
|
90
82
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"""
|
|
94
|
-
return self._groups
|
|
95
|
-
|
|
96
|
-
@groups.setter
|
|
97
|
-
def groups(self, groups):
|
|
98
|
-
"""Sets the groups of this NestedRole.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
:param groups: The groups of this NestedRole. # noqa: E501
|
|
102
|
-
:type: list[str]
|
|
103
|
-
"""
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
104
85
|
|
|
105
|
-
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"users": obj.get("users"),
|
|
88
|
+
"groups": obj.get("groups"),
|
|
89
|
+
"role": obj.get("role")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
106
92
|
|
|
107
|
-
@property
|
|
108
|
-
def role(self):
|
|
109
|
-
"""Gets the role of this NestedRole. # noqa: E501
|
|
110
93
|
|
|
111
|
-
|
|
112
|
-
:return: The role of this NestedRole. # noqa: E501
|
|
113
|
-
:rtype: str
|
|
114
|
-
"""
|
|
115
|
-
return self._role
|
|
116
|
-
|
|
117
|
-
@role.setter
|
|
118
|
-
def role(self, role):
|
|
119
|
-
"""Sets the role of this NestedRole.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
:param role: The role of this NestedRole. # noqa: E501
|
|
123
|
-
:type: str
|
|
124
|
-
"""
|
|
125
|
-
if self.local_vars_configuration.client_side_validation and role is None: # noqa: E501
|
|
126
|
-
raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501
|
|
127
|
-
if (self.local_vars_configuration.client_side_validation and
|
|
128
|
-
role is not None and len(role) < 1):
|
|
129
|
-
raise ValueError("Invalid value for `role`, length must be greater than or equal to `1`") # noqa: E501
|
|
130
|
-
|
|
131
|
-
self._role = role
|
|
132
|
-
|
|
133
|
-
def to_dict(self):
|
|
134
|
-
"""Returns the model properties as a dict"""
|
|
135
|
-
result = {}
|
|
136
|
-
|
|
137
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
|
138
|
-
value = getattr(self, attr)
|
|
139
|
-
if isinstance(value, list):
|
|
140
|
-
result[attr] = list(map(
|
|
141
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
142
|
-
value
|
|
143
|
-
))
|
|
144
|
-
elif hasattr(value, "to_dict"):
|
|
145
|
-
result[attr] = value.to_dict()
|
|
146
|
-
elif isinstance(value, dict):
|
|
147
|
-
result[attr] = dict(map(
|
|
148
|
-
lambda item: (item[0], item[1].to_dict())
|
|
149
|
-
if hasattr(item[1], "to_dict") else item,
|
|
150
|
-
value.items()
|
|
151
|
-
))
|
|
152
|
-
else:
|
|
153
|
-
result[attr] = value
|
|
154
|
-
|
|
155
|
-
return result
|
|
156
|
-
|
|
157
|
-
def to_str(self):
|
|
158
|
-
"""Returns the string representation of the model"""
|
|
159
|
-
return pprint.pformat(self.to_dict())
|
|
160
|
-
|
|
161
|
-
def __repr__(self):
|
|
162
|
-
"""For `print` and `pprint`"""
|
|
163
|
-
return self.to_str()
|
|
164
|
-
|
|
165
|
-
def __eq__(self, other):
|
|
166
|
-
"""Returns true if both objects are equal"""
|
|
167
|
-
if not isinstance(other, NestedRole):
|
|
168
|
-
return False
|
|
169
|
-
|
|
170
|
-
return self.to_dict() == other.to_dict()
|
|
171
|
-
|
|
172
|
-
def __ne__(self, other):
|
|
173
|
-
"""Returns true if both objects are not equal"""
|
|
174
|
-
if not isinstance(other, NestedRole):
|
|
175
|
-
return True
|
|
176
|
-
|
|
177
|
-
return self.to_dict() != other.to_dict()
|