crc-pulp-file-client 20250819.1__py3-none-any.whl → 20250821.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-pulp-file-client might be problematic. Click here for more details.

Files changed (63) hide show
  1. crc-pulp_file-client/api_client.py +1 -1
  2. crc-pulp_file-client/configuration.py +3 -3
  3. {crc_pulp_file_client-20250819.1.dist-info → crc_pulp_file_client-20250821.1.dist-info}/METADATA +1 -1
  4. crc_pulp_file_client-20250821.1.dist-info/RECORD +59 -0
  5. crc_pulp_file_client-20250821.1.dist-info/top_level.txt +1 -0
  6. crc_pulp_file_client-20250819.1.dist-info/RECORD +0 -114
  7. crc_pulp_file_client-20250819.1.dist-info/top_level.txt +0 -2
  8. services-pulp_file-client/__init__.py +0 -2
  9. services-pulp_file-client/api/__init__.py +0 -11
  10. services-pulp_file-client/api/acs_file_api.py +0 -3689
  11. services-pulp_file-client/api/content_files_api.py +0 -2088
  12. services-pulp_file-client/api/distributions_file_api.py +0 -4186
  13. services-pulp_file-client/api/publications_file_api.py +0 -2881
  14. services-pulp_file-client/api/remotes_file_api.py +0 -4214
  15. services-pulp_file-client/api/repositories_file_api.py +0 -4856
  16. services-pulp_file-client/api/repositories_file_versions_api.py +0 -1670
  17. services-pulp_file-client/api_client.py +0 -798
  18. services-pulp_file-client/api_response.py +0 -21
  19. services-pulp_file-client/configuration.py +0 -628
  20. services-pulp_file-client/exceptions.py +0 -200
  21. services-pulp_file-client/models/__init__.py +0 -56
  22. services-pulp_file-client/models/async_operation_response.py +0 -88
  23. services-pulp_file-client/models/content_summary_response.py +0 -92
  24. services-pulp_file-client/models/file_file_alternate_content_source.py +0 -101
  25. services-pulp_file-client/models/file_file_alternate_content_source_response.py +0 -116
  26. services-pulp_file-client/models/file_file_content_response.py +0 -133
  27. services-pulp_file-client/models/file_file_distribution.py +0 -118
  28. services-pulp_file-client/models/file_file_distribution_response.py +0 -142
  29. services-pulp_file-client/models/file_file_publication.py +0 -100
  30. services-pulp_file-client/models/file_file_publication_response.py +0 -120
  31. services-pulp_file-client/models/file_file_remote.py +0 -205
  32. services-pulp_file-client/models/file_file_remote_response.py +0 -199
  33. services-pulp_file-client/models/file_file_remote_response_hidden_fields_inner.py +0 -90
  34. services-pulp_file-client/models/file_file_repository.py +0 -121
  35. services-pulp_file-client/models/file_file_repository_response.py +0 -146
  36. services-pulp_file-client/models/my_permissions_response.py +0 -88
  37. services-pulp_file-client/models/nested_role.py +0 -93
  38. services-pulp_file-client/models/nested_role_response.py +0 -92
  39. services-pulp_file-client/models/object_roles_response.py +0 -96
  40. services-pulp_file-client/models/paginated_repository_version_response_list.py +0 -112
  41. services-pulp_file-client/models/paginatedfile_file_alternate_content_source_response_list.py +0 -112
  42. services-pulp_file-client/models/paginatedfile_file_content_response_list.py +0 -112
  43. services-pulp_file-client/models/paginatedfile_file_distribution_response_list.py +0 -112
  44. services-pulp_file-client/models/paginatedfile_file_publication_response_list.py +0 -112
  45. services-pulp_file-client/models/paginatedfile_file_remote_response_list.py +0 -112
  46. services-pulp_file-client/models/paginatedfile_file_repository_response_list.py +0 -112
  47. services-pulp_file-client/models/patchedfile_file_alternate_content_source.py +0 -101
  48. services-pulp_file-client/models/patchedfile_file_distribution.py +0 -118
  49. services-pulp_file-client/models/patchedfile_file_remote.py +0 -205
  50. services-pulp_file-client/models/patchedfile_file_repository.py +0 -121
  51. services-pulp_file-client/models/policy_enum.py +0 -39
  52. services-pulp_file-client/models/repair.py +0 -88
  53. services-pulp_file-client/models/repository_add_remove_content.py +0 -93
  54. services-pulp_file-client/models/repository_sync_url.py +0 -90
  55. services-pulp_file-client/models/repository_version_response.py +0 -121
  56. services-pulp_file-client/models/set_label.py +0 -103
  57. services-pulp_file-client/models/set_label_response.py +0 -103
  58. services-pulp_file-client/models/task_group_operation_response.py +0 -88
  59. services-pulp_file-client/models/unset_label.py +0 -96
  60. services-pulp_file-client/models/unset_label_response.py +0 -100
  61. services-pulp_file-client/py.typed +0 -0
  62. services-pulp_file-client/rest.py +0 -258
  63. {crc_pulp_file_client-20250819.1.dist-info → crc_pulp_file_client-20250821.1.dist-info}/WHEEL +0 -0
@@ -1,146 +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 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
-
@@ -1,88 +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, 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
-
@@ -1,93 +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 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
-
@@ -1,92 +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, 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
-
@@ -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
22
- from typing import Any, ClassVar, Dict, List
23
- from services-pulp_file-client.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
-
@@ -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, StrictInt, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from services-pulp_file-client.models.repository_version_response import RepositoryVersionResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class PaginatedRepositoryVersionResponseList(BaseModel):
28
- """
29
- PaginatedRepositoryVersionResponseList
30
- """ # noqa: E501
31
- count: StrictInt
32
- next: Optional[StrictStr] = None
33
- previous: Optional[StrictStr] = None
34
- results: List[RepositoryVersionResponse]
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 PaginatedRepositoryVersionResponseList 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 PaginatedRepositoryVersionResponseList 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": [RepositoryVersionResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
109
- })
110
- return _obj
111
-
112
-