crc-pulp-file-client 20251209.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of crc-pulp-file-client might be problematic. Click here for more details.

Files changed (62) hide show
  1. crc_pulp_file_client-20251209.2.dist-info/METADATA +8160 -0
  2. crc_pulp_file_client-20251209.2.dist-info/RECORD +62 -0
  3. crc_pulp_file_client-20251209.2.dist-info/WHEEL +5 -0
  4. crc_pulp_file_client-20251209.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_file/__init__.py +80 -0
  8. pulpcore/client/pulp_file/api/__init__.py +11 -0
  9. pulpcore/client/pulp_file/api/acs_file_api.py +3695 -0
  10. pulpcore/client/pulp_file/api/content_files_api.py +2472 -0
  11. pulpcore/client/pulp_file/api/distributions_file_api.py +4192 -0
  12. pulpcore/client/pulp_file/api/publications_file_api.py +2881 -0
  13. pulpcore/client/pulp_file/api/remotes_file_api.py +4220 -0
  14. pulpcore/client/pulp_file/api/repositories_file_api.py +4862 -0
  15. pulpcore/client/pulp_file/api/repositories_file_versions_api.py +1670 -0
  16. pulpcore/client/pulp_file/api_client.py +798 -0
  17. pulpcore/client/pulp_file/api_response.py +21 -0
  18. pulpcore/client/pulp_file/configuration.py +628 -0
  19. pulpcore/client/pulp_file/exceptions.py +200 -0
  20. pulpcore/client/pulp_file/models/__init__.py +57 -0
  21. pulpcore/client/pulp_file/models/async_operation_response.py +88 -0
  22. pulpcore/client/pulp_file/models/content_summary_response.py +92 -0
  23. pulpcore/client/pulp_file/models/file_content_upload_response.py +137 -0
  24. pulpcore/client/pulp_file/models/file_file_alternate_content_source.py +101 -0
  25. pulpcore/client/pulp_file/models/file_file_alternate_content_source_response.py +116 -0
  26. pulpcore/client/pulp_file/models/file_file_content_response.py +137 -0
  27. pulpcore/client/pulp_file/models/file_file_distribution.py +118 -0
  28. pulpcore/client/pulp_file/models/file_file_distribution_response.py +142 -0
  29. pulpcore/client/pulp_file/models/file_file_publication.py +100 -0
  30. pulpcore/client/pulp_file/models/file_file_publication_response.py +120 -0
  31. pulpcore/client/pulp_file/models/file_file_remote.py +205 -0
  32. pulpcore/client/pulp_file/models/file_file_remote_response.py +199 -0
  33. pulpcore/client/pulp_file/models/file_file_remote_response_hidden_fields_inner.py +90 -0
  34. pulpcore/client/pulp_file/models/file_file_repository.py +121 -0
  35. pulpcore/client/pulp_file/models/file_file_repository_response.py +146 -0
  36. pulpcore/client/pulp_file/models/my_permissions_response.py +88 -0
  37. pulpcore/client/pulp_file/models/nested_role.py +93 -0
  38. pulpcore/client/pulp_file/models/nested_role_response.py +92 -0
  39. pulpcore/client/pulp_file/models/object_roles_response.py +96 -0
  40. pulpcore/client/pulp_file/models/paginated_repository_version_response_list.py +112 -0
  41. pulpcore/client/pulp_file/models/paginatedfile_file_alternate_content_source_response_list.py +112 -0
  42. pulpcore/client/pulp_file/models/paginatedfile_file_content_response_list.py +112 -0
  43. pulpcore/client/pulp_file/models/paginatedfile_file_distribution_response_list.py +112 -0
  44. pulpcore/client/pulp_file/models/paginatedfile_file_publication_response_list.py +112 -0
  45. pulpcore/client/pulp_file/models/paginatedfile_file_remote_response_list.py +112 -0
  46. pulpcore/client/pulp_file/models/paginatedfile_file_repository_response_list.py +112 -0
  47. pulpcore/client/pulp_file/models/patchedfile_file_alternate_content_source.py +101 -0
  48. pulpcore/client/pulp_file/models/patchedfile_file_distribution.py +118 -0
  49. pulpcore/client/pulp_file/models/patchedfile_file_remote.py +205 -0
  50. pulpcore/client/pulp_file/models/patchedfile_file_repository.py +121 -0
  51. pulpcore/client/pulp_file/models/policy_enum.py +39 -0
  52. pulpcore/client/pulp_file/models/repair.py +88 -0
  53. pulpcore/client/pulp_file/models/repository_add_remove_content.py +93 -0
  54. pulpcore/client/pulp_file/models/repository_sync_url.py +90 -0
  55. pulpcore/client/pulp_file/models/repository_version_response.py +125 -0
  56. pulpcore/client/pulp_file/models/set_label.py +103 -0
  57. pulpcore/client/pulp_file/models/set_label_response.py +103 -0
  58. pulpcore/client/pulp_file/models/task_group_operation_response.py +88 -0
  59. pulpcore/client/pulp_file/models/unset_label.py +96 -0
  60. pulpcore/client/pulp_file/models/unset_label_response.py +100 -0
  61. pulpcore/client/pulp_file/py.typed +0 -0
  62. pulpcore/client/pulp_file/rest.py +258 -0
@@ -0,0 +1,116 @@
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, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class FileFileAlternateContentSourceResponse(BaseModel):
28
+ """
29
+ Serializer for File alternate content source.
30
+ """ # noqa: E501
31
+ pulp_href: Optional[StrictStr] = None
32
+ prn: Optional[StrictStr] = Field(default=None, description="The Pulp Resource Name (PRN).")
33
+ pulp_created: Optional[datetime] = Field(default=None, description="Timestamp of creation.")
34
+ 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.")
35
+ name: StrictStr = Field(description="Name of Alternate Content Source.")
36
+ last_refreshed: Optional[datetime] = Field(default=None, description="Date of last refresh of AlternateContentSource.")
37
+ paths: Optional[List[StrictStr]] = Field(default=None, description="List of paths that will be appended to the Remote url when searching for content.")
38
+ remote: StrictStr = Field(description="The remote to provide alternate content source.")
39
+ __properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "name", "last_refreshed", "paths", "remote"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of FileFileAlternateContentSourceResponse from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ * OpenAPI `readOnly` fields are excluded.
72
+ * OpenAPI `readOnly` fields are excluded.
73
+ * OpenAPI `readOnly` fields are excluded.
74
+ * OpenAPI `readOnly` fields are excluded.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ "pulp_href",
78
+ "prn",
79
+ "pulp_created",
80
+ "pulp_last_updated",
81
+ ])
82
+
83
+ _dict = self.model_dump(
84
+ by_alias=True,
85
+ exclude=excluded_fields,
86
+ exclude_none=True,
87
+ )
88
+ # set to None if last_refreshed (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.last_refreshed is None and "last_refreshed" in self.model_fields_set:
91
+ _dict['last_refreshed'] = 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 FileFileAlternateContentSourceResponse 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
+ "pulp_href": obj.get("pulp_href"),
106
+ "prn": obj.get("prn"),
107
+ "pulp_created": obj.get("pulp_created"),
108
+ "pulp_last_updated": obj.get("pulp_last_updated"),
109
+ "name": obj.get("name"),
110
+ "last_refreshed": obj.get("last_refreshed"),
111
+ "paths": obj.get("paths"),
112
+ "remote": obj.get("remote")
113
+ })
114
+ return _obj
115
+
116
+
@@ -0,0 +1,137 @@
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, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class FileFileContentResponse(BaseModel):
28
+ """
29
+ Serializer for File Content.
30
+ """ # noqa: E501
31
+ pulp_href: Optional[StrictStr] = None
32
+ prn: Optional[StrictStr] = Field(default=None, description="The Pulp Resource Name (PRN).")
33
+ pulp_created: Optional[datetime] = Field(default=None, description="Timestamp of creation.")
34
+ 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.")
35
+ pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = Field(default=None, description="A dictionary of arbitrary key/value pairs used to describe a specific Content instance.")
36
+ vuln_report: Optional[StrictStr] = None
37
+ artifact: Optional[StrictStr] = Field(default=None, description="Artifact file representing the physical content")
38
+ relative_path: StrictStr = Field(description="Path where the artifact is located relative to distributions base_path")
39
+ md5: Optional[StrictStr] = Field(default=None, description="The MD5 checksum if available.")
40
+ sha1: Optional[StrictStr] = Field(default=None, description="The SHA-1 checksum if available.")
41
+ sha224: Optional[StrictStr] = Field(default=None, description="The SHA-224 checksum if available.")
42
+ sha256: Optional[StrictStr] = Field(default=None, description="The SHA-256 checksum if available.")
43
+ sha384: Optional[StrictStr] = Field(default=None, description="The SHA-384 checksum if available.")
44
+ sha512: Optional[StrictStr] = Field(default=None, description="The SHA-512 checksum if available.")
45
+ __properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "pulp_labels", "vuln_report", "artifact", "relative_path", "md5", "sha1", "sha224", "sha256", "sha384", "sha512"]
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 FileFileContentResponse 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
+ * OpenAPI `readOnly` fields are excluded.
84
+ * OpenAPI `readOnly` fields are excluded.
85
+ * OpenAPI `readOnly` fields are excluded.
86
+ * OpenAPI `readOnly` fields are excluded.
87
+ * OpenAPI `readOnly` fields are excluded.
88
+ """
89
+ excluded_fields: Set[str] = set([
90
+ "pulp_href",
91
+ "prn",
92
+ "pulp_created",
93
+ "pulp_last_updated",
94
+ "vuln_report",
95
+ "md5",
96
+ "sha1",
97
+ "sha224",
98
+ "sha256",
99
+ "sha384",
100
+ "sha512",
101
+ ])
102
+
103
+ _dict = self.model_dump(
104
+ by_alias=True,
105
+ exclude=excluded_fields,
106
+ exclude_none=True,
107
+ )
108
+ return _dict
109
+
110
+ @classmethod
111
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
112
+ """Create an instance of FileFileContentResponse from a dict"""
113
+ if obj is None:
114
+ return None
115
+
116
+ if not isinstance(obj, dict):
117
+ return cls.model_validate(obj)
118
+
119
+ _obj = cls.model_validate({
120
+ "pulp_href": obj.get("pulp_href"),
121
+ "prn": obj.get("prn"),
122
+ "pulp_created": obj.get("pulp_created"),
123
+ "pulp_last_updated": obj.get("pulp_last_updated"),
124
+ "pulp_labels": obj.get("pulp_labels"),
125
+ "vuln_report": obj.get("vuln_report"),
126
+ "artifact": obj.get("artifact"),
127
+ "relative_path": obj.get("relative_path"),
128
+ "md5": obj.get("md5"),
129
+ "sha1": obj.get("sha1"),
130
+ "sha224": obj.get("sha224"),
131
+ "sha256": obj.get("sha256"),
132
+ "sha384": obj.get("sha384"),
133
+ "sha512": obj.get("sha512")
134
+ })
135
+ return _obj
136
+
137
+
@@ -0,0 +1,118 @@
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 FileFileDistribution(BaseModel):
28
+ """
29
+ Serializer for File Distributions.
30
+ """ # noqa: E501
31
+ base_path: Annotated[str, Field(min_length=1, strict=True)] = Field(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: Annotated[str, Field(min_length=1, strict=True)] = Field(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
+ publication: Optional[StrictStr] = Field(default=None, description="Publication to be served")
38
+ checkpoint: Optional[StrictBool] = None
39
+ __properties: ClassVar[List[str]] = ["base_path", "content_guard", "hidden", "pulp_labels", "name", "repository", "publication", "checkpoint"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of FileFileDistribution from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # set to None if content_guard (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.content_guard is None and "content_guard" in self.model_fields_set:
83
+ _dict['content_guard'] = None
84
+
85
+ # set to None if repository (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.repository is None and "repository" in self.model_fields_set:
88
+ _dict['repository'] = None
89
+
90
+ # set to None if publication (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.publication is None and "publication" in self.model_fields_set:
93
+ _dict['publication'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of FileFileDistribution from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "base_path": obj.get("base_path"),
108
+ "content_guard": obj.get("content_guard"),
109
+ "hidden": obj.get("hidden") if obj.get("hidden") is not None else False,
110
+ "pulp_labels": obj.get("pulp_labels"),
111
+ "name": obj.get("name"),
112
+ "repository": obj.get("repository"),
113
+ "publication": obj.get("publication"),
114
+ "checkpoint": obj.get("checkpoint")
115
+ })
116
+ return _obj
117
+
118
+
@@ -0,0 +1,142 @@
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 import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class FileFileDistributionResponse(BaseModel):
28
+ """
29
+ Serializer for File Distributions.
30
+ """ # noqa: E501
31
+ pulp_href: Optional[StrictStr] = None
32
+ prn: Optional[StrictStr] = Field(default=None, description="The Pulp Resource Name (PRN).")
33
+ pulp_created: Optional[datetime] = Field(default=None, description="Timestamp of creation.")
34
+ 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.")
35
+ base_path: StrictStr = Field(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\")")
36
+ base_url: Optional[StrictStr] = Field(default=None, description="The URL for accessing the publication as defined by this distribution.")
37
+ content_guard: Optional[StrictStr] = Field(default=None, description="An optional content-guard.")
38
+ no_content_change_since: Optional[StrictStr] = Field(default=None, description="Timestamp since when the distributed content served by this distribution has not changed. If equals to `null`, no guarantee is provided about content changes.")
39
+ hidden: Optional[StrictBool] = Field(default=False, description="Whether this distribution should be shown in the content app.")
40
+ pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
41
+ name: StrictStr = Field(description="A unique name. Ex, `rawhide` and `stable`.")
42
+ repository: Optional[StrictStr] = Field(default=None, description="The latest RepositoryVersion for this Repository will be served.")
43
+ publication: Optional[StrictStr] = Field(default=None, description="Publication to be served")
44
+ checkpoint: Optional[StrictBool] = None
45
+ __properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "base_path", "base_url", "content_guard", "no_content_change_since", "hidden", "pulp_labels", "name", "repository", "publication", "checkpoint"]
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 FileFileDistributionResponse 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
+ "base_url",
90
+ "no_content_change_since",
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 content_guard (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.content_guard is None and "content_guard" in self.model_fields_set:
101
+ _dict['content_guard'] = None
102
+
103
+ # set to None if repository (nullable) is None
104
+ # and model_fields_set contains the field
105
+ if self.repository is None and "repository" in self.model_fields_set:
106
+ _dict['repository'] = None
107
+
108
+ # set to None if publication (nullable) is None
109
+ # and model_fields_set contains the field
110
+ if self.publication is None and "publication" in self.model_fields_set:
111
+ _dict['publication'] = None
112
+
113
+ return _dict
114
+
115
+ @classmethod
116
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
117
+ """Create an instance of FileFileDistributionResponse from a dict"""
118
+ if obj is None:
119
+ return None
120
+
121
+ if not isinstance(obj, dict):
122
+ return cls.model_validate(obj)
123
+
124
+ _obj = cls.model_validate({
125
+ "pulp_href": obj.get("pulp_href"),
126
+ "prn": obj.get("prn"),
127
+ "pulp_created": obj.get("pulp_created"),
128
+ "pulp_last_updated": obj.get("pulp_last_updated"),
129
+ "base_path": obj.get("base_path"),
130
+ "base_url": obj.get("base_url"),
131
+ "content_guard": obj.get("content_guard"),
132
+ "no_content_change_since": obj.get("no_content_change_since"),
133
+ "hidden": obj.get("hidden") if obj.get("hidden") is not None else False,
134
+ "pulp_labels": obj.get("pulp_labels"),
135
+ "name": obj.get("name"),
136
+ "repository": obj.get("repository"),
137
+ "publication": obj.get("publication"),
138
+ "checkpoint": obj.get("checkpoint")
139
+ })
140
+ return _obj
141
+
142
+
@@ -0,0 +1,100 @@
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 FileFilePublication(BaseModel):
28
+ """
29
+ Serializer for File Publications.
30
+ """ # noqa: E501
31
+ repository_version: Optional[StrictStr] = None
32
+ repository: Optional[StrictStr] = Field(default=None, description="A URI of the repository to be published.")
33
+ manifest: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default='PULP_MANIFEST', description="Filename to use for manifest file containing metadata for all the files.")
34
+ checkpoint: Optional[StrictBool] = None
35
+ __properties: ClassVar[List[str]] = ["repository_version", "repository", "manifest", "checkpoint"]
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 FileFilePublication 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 manifest (nullable) is None
77
+ # and model_fields_set contains the field
78
+ if self.manifest is None and "manifest" in self.model_fields_set:
79
+ _dict['manifest'] = 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 FileFilePublication 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
+ "repository_version": obj.get("repository_version"),
94
+ "repository": obj.get("repository"),
95
+ "manifest": obj.get("manifest") if obj.get("manifest") is not None else 'PULP_MANIFEST',
96
+ "checkpoint": obj.get("checkpoint")
97
+ })
98
+ return _obj
99
+
100
+