crc-pulp-service-client 20260107.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-service-client might be problematic. Click here for more details.

Files changed (41) hide show
  1. crc_pulp_service_client-20260107.2.dist-info/METADATA +2727 -0
  2. crc_pulp_service_client-20260107.2.dist-info/RECORD +41 -0
  3. crc_pulp_service_client-20260107.2.dist-info/WHEEL +5 -0
  4. crc_pulp_service_client-20260107.2.dist-info/top_level.txt +1 -0
  5. pulpcore/__init__.py +2 -0
  6. pulpcore/client/__init__.py +2 -0
  7. pulpcore/client/pulp_service/__init__.py +59 -0
  8. pulpcore/client/pulp_service/api/__init__.py +13 -0
  9. pulpcore/client/pulp_service/api/api_create_domain_api.py +335 -0
  10. pulpcore/client/pulp_service/api/api_debug_auth_header_api.py +329 -0
  11. pulpcore/client/pulp_service/api/api_debug_database_triggers_api.py +329 -0
  12. pulpcore/client/pulp_service/api/api_rds_connection_tests_api.py +591 -0
  13. pulpcore/client/pulp_service/api/api_test_random_lock_tasks_api.py +326 -0
  14. pulpcore/client/pulp_service/api/api_test_tasks_api.py +326 -0
  15. pulpcore/client/pulp_service/api/contentguards_feature_api.py +3401 -0
  16. pulpcore/client/pulp_service/api/tasks_api.py +1469 -0
  17. pulpcore/client/pulp_service/api/vuln_report_service_api.py +1301 -0
  18. pulpcore/client/pulp_service/api_client.py +798 -0
  19. pulpcore/client/pulp_service/api_response.py +21 -0
  20. pulpcore/client/pulp_service/configuration.py +628 -0
  21. pulpcore/client/pulp_service/exceptions.py +200 -0
  22. pulpcore/client/pulp_service/models/__init__.py +34 -0
  23. pulpcore/client/pulp_service/models/async_operation_response.py +88 -0
  24. pulpcore/client/pulp_service/models/domain.py +114 -0
  25. pulpcore/client/pulp_service/models/domain_response.py +131 -0
  26. pulpcore/client/pulp_service/models/my_permissions_response.py +88 -0
  27. pulpcore/client/pulp_service/models/nested_role.py +93 -0
  28. pulpcore/client/pulp_service/models/nested_role_response.py +92 -0
  29. pulpcore/client/pulp_service/models/object_roles_response.py +96 -0
  30. pulpcore/client/pulp_service/models/paginated_task_response_list.py +112 -0
  31. pulpcore/client/pulp_service/models/paginatedservice_feature_content_guard_response_list.py +112 -0
  32. pulpcore/client/pulp_service/models/paginatedservice_vulnerability_report_response_list.py +112 -0
  33. pulpcore/client/pulp_service/models/patchedservice_feature_content_guard.py +107 -0
  34. pulpcore/client/pulp_service/models/progress_report_response.py +115 -0
  35. pulpcore/client/pulp_service/models/service_feature_content_guard.py +107 -0
  36. pulpcore/client/pulp_service/models/service_feature_content_guard_response.py +123 -0
  37. pulpcore/client/pulp_service/models/service_vulnerability_report_response.py +110 -0
  38. pulpcore/client/pulp_service/models/storage_class_enum.py +40 -0
  39. pulpcore/client/pulp_service/models/task_response.py +186 -0
  40. pulpcore/client/pulp_service/py.typed +0 -0
  41. pulpcore/client/pulp_service/rest.py +258 -0
@@ -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_service.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
+
@@ -0,0 +1,112 @@
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, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from pulpcore.client.pulp_service.models.task_response import TaskResponse
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class PaginatedTaskResponseList(BaseModel):
28
+ """
29
+ PaginatedTaskResponseList
30
+ """ # noqa: E501
31
+ count: StrictInt
32
+ next: Optional[StrictStr] = None
33
+ previous: Optional[StrictStr] = None
34
+ results: List[TaskResponse]
35
+ __properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
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 PaginatedTaskResponseList 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
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
+ _items = []
78
+ if self.results:
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
+ _dict['results'] = _items
83
+ # set to None if next (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.next is None and "next" in self.model_fields_set:
86
+ _dict['next'] = None
87
+
88
+ # set to None if previous (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.previous is None and "previous" in self.model_fields_set:
91
+ _dict['previous'] = None
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of PaginatedTaskResponseList from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "count": obj.get("count"),
106
+ "next": obj.get("next"),
107
+ "previous": obj.get("previous"),
108
+ "results": [TaskResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
109
+ })
110
+ return _obj
111
+
112
+
@@ -0,0 +1,112 @@
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, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from pulpcore.client.pulp_service.models.service_feature_content_guard_response import ServiceFeatureContentGuardResponse
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class PaginatedserviceFeatureContentGuardResponseList(BaseModel):
28
+ """
29
+ PaginatedserviceFeatureContentGuardResponseList
30
+ """ # noqa: E501
31
+ count: StrictInt
32
+ next: Optional[StrictStr] = None
33
+ previous: Optional[StrictStr] = None
34
+ results: List[ServiceFeatureContentGuardResponse]
35
+ __properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
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 PaginatedserviceFeatureContentGuardResponseList 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
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
+ _items = []
78
+ if self.results:
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
+ _dict['results'] = _items
83
+ # set to None if next (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.next is None and "next" in self.model_fields_set:
86
+ _dict['next'] = None
87
+
88
+ # set to None if previous (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.previous is None and "previous" in self.model_fields_set:
91
+ _dict['previous'] = None
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of PaginatedserviceFeatureContentGuardResponseList from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "count": obj.get("count"),
106
+ "next": obj.get("next"),
107
+ "previous": obj.get("previous"),
108
+ "results": [ServiceFeatureContentGuardResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
109
+ })
110
+ return _obj
111
+
112
+
@@ -0,0 +1,112 @@
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, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from pulpcore.client.pulp_service.models.service_vulnerability_report_response import ServiceVulnerabilityReportResponse
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class PaginatedserviceVulnerabilityReportResponseList(BaseModel):
28
+ """
29
+ PaginatedserviceVulnerabilityReportResponseList
30
+ """ # noqa: E501
31
+ count: StrictInt
32
+ next: Optional[StrictStr] = None
33
+ previous: Optional[StrictStr] = None
34
+ results: List[ServiceVulnerabilityReportResponse]
35
+ __properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
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 PaginatedserviceVulnerabilityReportResponseList 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
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
+ _items = []
78
+ if self.results:
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
+ _dict['results'] = _items
83
+ # set to None if next (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.next is None and "next" in self.model_fields_set:
86
+ _dict['next'] = None
87
+
88
+ # set to None if previous (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.previous is None and "previous" in self.model_fields_set:
91
+ _dict['previous'] = None
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of PaginatedserviceVulnerabilityReportResponseList from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "count": obj.get("count"),
106
+ "next": obj.get("next"),
107
+ "previous": obj.get("previous"),
108
+ "results": [ServiceVulnerabilityReportResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
109
+ })
110
+ return _obj
111
+
112
+