pulp-python-client 3.12.5__py3-none-any.whl → 3.13.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 pulp-python-client might be problematic. Click here for more details.

Files changed (68) hide show
  1. pulp_python_client-3.13.1.dist-info/METADATA +17 -0
  2. pulp_python_client-3.13.1.dist-info/RECORD +64 -0
  3. {pulp_python_client-3.12.5.dist-info → pulp_python_client-3.13.1.dist-info}/WHEEL +1 -1
  4. pulpcore/client/pulp_python/__init__.py +9 -10
  5. pulpcore/client/pulp_python/api/__init__.py +1 -2
  6. pulpcore/client/pulp_python/api/content_packages_api.py +1800 -655
  7. pulpcore/client/pulp_python/api/distributions_pypi_api.py +3755 -1474
  8. pulpcore/client/pulp_python/api/publications_pypi_api.py +2574 -982
  9. pulpcore/client/pulp_python/api/pypi_api.py +302 -128
  10. pulpcore/client/pulp_python/api/pypi_legacy_api.py +326 -153
  11. pulpcore/client/pulp_python/api/pypi_metadata_api.py +319 -139
  12. pulpcore/client/pulp_python/api/pypi_simple_api.py +899 -382
  13. pulpcore/client/pulp_python/api/remotes_python_api.py +4092 -1589
  14. pulpcore/client/pulp_python/api/repositories_python_api.py +4380 -1719
  15. pulpcore/client/pulp_python/api/repositories_python_versions_api.py +1526 -561
  16. pulpcore/client/pulp_python/api_client.py +444 -313
  17. pulpcore/client/pulp_python/api_response.py +21 -0
  18. pulpcore/client/pulp_python/configuration.py +266 -73
  19. pulpcore/client/pulp_python/exceptions.py +99 -20
  20. pulpcore/client/pulp_python/models/__init__.py +5 -8
  21. pulpcore/client/pulp_python/models/async_operation_response.py +60 -96
  22. pulpcore/client/pulp_python/models/content_summary_response.py +70 -154
  23. pulpcore/client/pulp_python/models/exclude_platforms_enum.py +19 -82
  24. pulpcore/client/pulp_python/models/my_permissions_response.py +60 -94
  25. pulpcore/client/pulp_python/models/nested_role.py +71 -155
  26. pulpcore/client/pulp_python/models/nested_role_response.py +70 -152
  27. pulpcore/client/pulp_python/models/object_roles_response.py +70 -96
  28. pulpcore/client/pulp_python/models/package_metadata_response.py +91 -191
  29. pulpcore/client/pulp_python/models/package_types_enum.py +23 -86
  30. pulpcore/client/pulp_python/models/package_upload_task_response.py +85 -154
  31. pulpcore/client/pulp_python/models/paginated_repository_version_response_list.py +94 -181
  32. pulpcore/client/pulp_python/models/paginatedpython_python_distribution_response_list.py +94 -181
  33. pulpcore/client/pulp_python/models/paginatedpython_python_package_content_response_list.py +94 -181
  34. pulpcore/client/pulp_python/models/paginatedpython_python_publication_response_list.py +94 -181
  35. pulpcore/client/pulp_python/models/paginatedpython_python_remote_response_list.py +94 -181
  36. pulpcore/client/pulp_python/models/paginatedpython_python_repository_response_list.py +94 -181
  37. pulpcore/client/pulp_python/models/patchedpython_python_distribution.py +108 -330
  38. pulpcore/client/pulp_python/models/patchedpython_python_remote.py +204 -864
  39. pulpcore/client/pulp_python/models/patchedpython_python_repository.py +96 -249
  40. pulpcore/client/pulp_python/models/policy_enum.py +18 -81
  41. pulpcore/client/pulp_python/models/python_python_distribution.py +108 -332
  42. pulpcore/client/pulp_python/models/python_python_distribution_response.py +132 -490
  43. pulpcore/client/pulp_python/models/python_python_package_content_response.py +182 -972
  44. pulpcore/client/pulp_python/models/python_python_publication.py +68 -127
  45. pulpcore/client/pulp_python/models/python_python_publication_response.py +93 -269
  46. pulpcore/client/pulp_python/models/python_python_remote.py +204 -866
  47. pulpcore/client/pulp_python/models/python_python_remote_response.py +198 -839
  48. pulpcore/client/pulp_python/models/python_python_remote_response_hidden_fields_inner.py +90 -0
  49. pulpcore/client/pulp_python/models/python_python_repository.py +96 -250
  50. pulpcore/client/pulp_python/models/python_python_repository_response.py +122 -407
  51. pulpcore/client/pulp_python/models/repair.py +60 -95
  52. pulpcore/client/pulp_python/models/repository_add_remove_content.py +71 -157
  53. pulpcore/client/pulp_python/models/repository_sync_url.py +68 -129
  54. pulpcore/client/pulp_python/models/repository_version_response.py +104 -296
  55. pulpcore/client/pulp_python/models/set_label.py +80 -130
  56. pulpcore/client/pulp_python/models/set_label_response.py +80 -127
  57. pulpcore/client/pulp_python/models/summary_response.py +70 -160
  58. pulpcore/client/pulp_python/models/unset_label.py +75 -107
  59. pulpcore/client/pulp_python/models/unset_label_response.py +78 -129
  60. pulpcore/client/pulp_python/py.typed +0 -0
  61. pulpcore/client/pulp_python/rest.py +136 -170
  62. pulp_python_client-3.12.5.dist-info/METADATA +0 -17
  63. pulp_python_client-3.12.5.dist-info/RECORD +0 -65
  64. pulpcore/client/pulp_python/models/package_upload.py +0 -190
  65. pulpcore/client/pulp_python/models/python_bander_remote.py +0 -184
  66. pulpcore/client/pulp_python/models/python_python_package_content.py +0 -889
  67. pulpcore/client/pulp_python/models/python_python_remote_response_hidden_fields.py +0 -149
  68. {pulp_python_client-3.12.5.dist-info → pulp_python_client-3.13.1.dist-info}/top_level.txt +0 -0
@@ -3,121 +3,86 @@
3
3
  """
4
4
  Pulp 3 API
5
5
 
6
- Fetch, Upload, Organize, and Distribute Software Packages # noqa: E501
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: https://openapi-generator.tech
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 six
18
-
19
- from pulpcore.client.pulp_python.configuration import Configuration
20
-
21
-
22
- class Repair(object):
23
- """NOTE: This class is auto generated by OpenAPI Generator.
24
- Ref: https://openapi-generator.tech
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
25
 
26
- Do not edit the class manually.
26
+ class Repair(BaseModel):
27
27
  """
28
+ Repair
29
+ """ # noqa: E501
30
+ verify_checksums: Optional[StrictBool] = Field(default=True, description="Will verify that the checksum of all stored files matches what saved in the database. Otherwise only the existence of the files will be checked. Enabled by default")
31
+ __properties: ClassVar[List[str]] = ["verify_checksums"]
28
32
 
29
- """
30
- Attributes:
31
- openapi_types (dict): The key is attribute name
32
- and the value is attribute type.
33
- attribute_map (dict): The key is attribute name
34
- and the value is json key in definition.
35
- """
36
- openapi_types = {
37
- 'verify_checksums': 'bool'
38
- }
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
39
38
 
40
- attribute_map = {
41
- 'verify_checksums': 'verify_checksums'
42
- }
43
39
 
44
- def __init__(self, verify_checksums=True, local_vars_configuration=None): # noqa: E501
45
- """Repair - a model defined in OpenAPI""" # noqa: E501
46
- if local_vars_configuration is None:
47
- local_vars_configuration = Configuration()
48
- self.local_vars_configuration = local_vars_configuration
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))
49
43
 
50
- self._verify_checksums = None
51
- self.discriminator = None
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())
52
48
 
53
- if verify_checksums is not None:
54
- self.verify_checksums = verify_checksums
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of Repair from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
55
53
 
56
- @property
57
- def verify_checksums(self):
58
- """Gets the verify_checksums of this Repair. # noqa: E501
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
59
56
 
60
- Will verify that the checksum of all stored files matches what saved in the database. Otherwise only the existence of the files will be checked. Enabled by default # noqa: E501
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
61
59
 
62
- :return: The verify_checksums of this Repair. # noqa: E501
63
- :rtype: bool
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.
64
63
  """
65
- return self._verify_checksums
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
66
 
67
- @verify_checksums.setter
68
- def verify_checksums(self, verify_checksums):
69
- """Sets the verify_checksums of this Repair.
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
70
73
 
71
- Will verify that the checksum of all stored files matches what saved in the database. Otherwise only the existence of the files will be checked. Enabled by default # noqa: E501
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of Repair 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
+ "verify_checksums": obj.get("verify_checksums") if obj.get("verify_checksums") is not None else True
85
+ })
86
+ return _obj
72
87
 
73
- :param verify_checksums: The verify_checksums of this Repair. # noqa: E501
74
- :type: bool
75
- """
76
88
 
77
- self._verify_checksums = verify_checksums
78
-
79
- def to_dict(self):
80
- """Returns the model properties as a dict"""
81
- result = {}
82
-
83
- for attr, _ in six.iteritems(self.openapi_types):
84
- value = getattr(self, attr)
85
- if isinstance(value, list):
86
- result[attr] = list(map(
87
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
88
- value
89
- ))
90
- elif hasattr(value, "to_dict"):
91
- result[attr] = value.to_dict()
92
- elif isinstance(value, dict):
93
- result[attr] = dict(map(
94
- lambda item: (item[0], item[1].to_dict())
95
- if hasattr(item[1], "to_dict") else item,
96
- value.items()
97
- ))
98
- else:
99
- result[attr] = value
100
-
101
- return result
102
-
103
- def to_str(self):
104
- """Returns the string representation of the model"""
105
- return pprint.pformat(self.to_dict())
106
-
107
- def __repr__(self):
108
- """For `print` and `pprint`"""
109
- return self.to_str()
110
-
111
- def __eq__(self, other):
112
- """Returns true if both objects are equal"""
113
- if not isinstance(other, Repair):
114
- return False
115
-
116
- return self.to_dict() == other.to_dict()
117
-
118
- def __ne__(self, other):
119
- """Returns true if both objects are not equal"""
120
- if not isinstance(other, Repair):
121
- return True
122
-
123
- return self.to_dict() != other.to_dict()
@@ -3,177 +3,91 @@
3
3
  """
4
4
  Pulp 3 API
5
5
 
6
- Fetch, Upload, Organize, and Distribute Software Packages # noqa: E501
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: https://openapi-generator.tech
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 six
18
-
19
- from pulpcore.client.pulp_python.configuration import Configuration
20
-
21
-
22
- class RepositoryAddRemoveContent(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
- """
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
28
26
 
27
+ class RepositoryAddRemoveContent(BaseModel):
29
28
  """
30
- Attributes:
31
- openapi_types (dict): The key is attribute name
32
- and the value is attribute type.
33
- attribute_map (dict): The key is attribute name
34
- and the value is json key in definition.
35
- """
36
- openapi_types = {
37
- 'add_content_units': 'list[str]',
38
- 'remove_content_units': 'list[str]',
39
- 'base_version': 'str'
40
- }
41
-
42
- attribute_map = {
43
- 'add_content_units': 'add_content_units',
44
- 'remove_content_units': 'remove_content_units',
45
- 'base_version': 'base_version'
46
- }
47
-
48
- def __init__(self, add_content_units=None, remove_content_units=None, base_version=None, local_vars_configuration=None): # noqa: E501
49
- """RepositoryAddRemoveContent - a model defined in OpenAPI""" # noqa: E501
50
- if local_vars_configuration is None:
51
- local_vars_configuration = Configuration()
52
- self.local_vars_configuration = local_vars_configuration
53
-
54
- self._add_content_units = None
55
- self._remove_content_units = None
56
- self._base_version = None
57
- self.discriminator = None
58
-
59
- if add_content_units is not None:
60
- self.add_content_units = add_content_units
61
- if remove_content_units is not None:
62
- self.remove_content_units = remove_content_units
63
- if base_version is not None:
64
- self.base_version = base_version
65
-
66
- @property
67
- def add_content_units(self):
68
- """Gets the add_content_units of this RepositoryAddRemoveContent. # noqa: E501
69
-
70
- A list of content units to add to a new repository version. This content is added after remove_content_units are removed. # noqa: E501
71
-
72
- :return: The add_content_units of this RepositoryAddRemoveContent. # noqa: E501
73
- :rtype: list[str]
29
+ Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
30
+ """ # noqa: E501
31
+ add_content_units: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = Field(default=None, description="A list of content units to add to a new repository version. This content is added after remove_content_units are removed.")
32
+ remove_content_units: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = Field(default=None, description="A list of content units to remove from the latest repository version. You may also specify '*' as an entry to remove all content. This content is removed before add_content_units are added.")
33
+ base_version: Optional[StrictStr] = Field(default=None, description="A repository version whose content will be used as the initial set of content for the new repository version")
34
+ __properties: ClassVar[List[str]] = ["add_content_units", "remove_content_units", "base_version"]
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 RepositoryAddRemoveContent 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.
74
66
  """
75
- return self._add_content_units
67
+ excluded_fields: Set[str] = set([
68
+ ])
76
69
 
77
- @add_content_units.setter
78
- def add_content_units(self, add_content_units):
79
- """Sets the add_content_units of this RepositoryAddRemoveContent.
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
80
76
 
81
- A list of content units to add to a new repository version. This content is added after remove_content_units are removed. # noqa: E501
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of RepositoryAddRemoveContent from a dict"""
80
+ if obj is None:
81
+ return None
82
82
 
83
- :param add_content_units: The add_content_units of this RepositoryAddRemoveContent. # noqa: E501
84
- :type: list[str]
85
- """
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
86
85
 
87
- self._add_content_units = add_content_units
86
+ _obj = cls.model_validate({
87
+ "add_content_units": obj.get("add_content_units"),
88
+ "remove_content_units": obj.get("remove_content_units"),
89
+ "base_version": obj.get("base_version")
90
+ })
91
+ return _obj
88
92
 
89
- @property
90
- def remove_content_units(self):
91
- """Gets the remove_content_units of this RepositoryAddRemoveContent. # noqa: E501
92
-
93
- A list of content units to remove from the latest repository version. You may also specify '*' as an entry to remove all content. This content is removed before add_content_units are added. # noqa: E501
94
-
95
- :return: The remove_content_units of this RepositoryAddRemoveContent. # noqa: E501
96
- :rtype: list[str]
97
- """
98
- return self._remove_content_units
99
-
100
- @remove_content_units.setter
101
- def remove_content_units(self, remove_content_units):
102
- """Sets the remove_content_units of this RepositoryAddRemoveContent.
103
-
104
- A list of content units to remove from the latest repository version. You may also specify '*' as an entry to remove all content. This content is removed before add_content_units are added. # noqa: E501
105
-
106
- :param remove_content_units: The remove_content_units of this RepositoryAddRemoveContent. # noqa: E501
107
- :type: list[str]
108
- """
109
-
110
- self._remove_content_units = remove_content_units
111
-
112
- @property
113
- def base_version(self):
114
- """Gets the base_version of this RepositoryAddRemoveContent. # noqa: E501
115
-
116
- A repository version whose content will be used as the initial set of content for the new repository version # noqa: E501
117
-
118
- :return: The base_version of this RepositoryAddRemoveContent. # noqa: E501
119
- :rtype: str
120
- """
121
- return self._base_version
122
-
123
- @base_version.setter
124
- def base_version(self, base_version):
125
- """Sets the base_version of this RepositoryAddRemoveContent.
126
-
127
- A repository version whose content will be used as the initial set of content for the new repository version # noqa: E501
128
-
129
- :param base_version: The base_version of this RepositoryAddRemoveContent. # noqa: E501
130
- :type: str
131
- """
132
93
 
133
- self._base_version = base_version
134
-
135
- def to_dict(self):
136
- """Returns the model properties as a dict"""
137
- result = {}
138
-
139
- for attr, _ in six.iteritems(self.openapi_types):
140
- value = getattr(self, attr)
141
- if isinstance(value, list):
142
- result[attr] = list(map(
143
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
144
- value
145
- ))
146
- elif hasattr(value, "to_dict"):
147
- result[attr] = value.to_dict()
148
- elif isinstance(value, dict):
149
- result[attr] = dict(map(
150
- lambda item: (item[0], item[1].to_dict())
151
- if hasattr(item[1], "to_dict") else item,
152
- value.items()
153
- ))
154
- else:
155
- result[attr] = value
156
-
157
- return result
158
-
159
- def to_str(self):
160
- """Returns the string representation of the model"""
161
- return pprint.pformat(self.to_dict())
162
-
163
- def __repr__(self):
164
- """For `print` and `pprint`"""
165
- return self.to_str()
166
-
167
- def __eq__(self, other):
168
- """Returns true if both objects are equal"""
169
- if not isinstance(other, RepositoryAddRemoveContent):
170
- return False
171
-
172
- return self.to_dict() == other.to_dict()
173
-
174
- def __ne__(self, other):
175
- """Returns true if both objects are not equal"""
176
- if not isinstance(other, RepositoryAddRemoveContent):
177
- return True
178
-
179
- return self.to_dict() != other.to_dict()
@@ -3,149 +3,88 @@
3
3
  """
4
4
  Pulp 3 API
5
5
 
6
- Fetch, Upload, Organize, and Distribute Software Packages # noqa: E501
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: https://openapi-generator.tech
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 six
18
-
19
- from pulpcore.client.pulp_python.configuration import Configuration
20
-
21
-
22
- class RepositorySyncURL(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
- """
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
28
25
 
26
+ class RepositorySyncURL(BaseModel):
29
27
  """
30
- Attributes:
31
- openapi_types (dict): The key is attribute name
32
- and the value is attribute type.
33
- attribute_map (dict): The key is attribute name
34
- and the value is json key in definition.
35
- """
36
- openapi_types = {
37
- 'remote': 'str',
38
- 'mirror': 'bool'
39
- }
40
-
41
- attribute_map = {
42
- 'remote': 'remote',
43
- 'mirror': 'mirror'
44
- }
45
-
46
- def __init__(self, remote=None, mirror=False, local_vars_configuration=None): # noqa: E501
47
- """RepositorySyncURL - a model defined in OpenAPI""" # noqa: E501
48
- if local_vars_configuration is None:
49
- local_vars_configuration = Configuration()
50
- self.local_vars_configuration = local_vars_configuration
51
-
52
- self._remote = None
53
- self._mirror = None
54
- self.discriminator = None
55
-
56
- if remote is not None:
57
- self.remote = remote
58
- if mirror is not None:
59
- self.mirror = mirror
60
-
61
- @property
62
- def remote(self):
63
- """Gets the remote of this RepositorySyncURL. # noqa: E501
64
-
65
- A remote to sync from. This will override a remote set on repository. # noqa: E501
66
-
67
- :return: The remote of this RepositorySyncURL. # noqa: E501
68
- :rtype: str
28
+ A mixin for validating unknown serializers' fields.
29
+ """ # noqa: E501
30
+ remote: Optional[StrictStr] = Field(default=None, description="A remote to sync from. This will override a remote set on repository.")
31
+ mirror: Optional[StrictBool] = Field(default=False, description="If ``True``, synchronization will remove all content that is not present in the remote repository. If ``False``, sync will be additive only.")
32
+ __properties: ClassVar[List[str]] = ["remote", "mirror"]
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 RepositorySyncURL 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.
69
64
  """
70
- return self._remote
71
-
72
- @remote.setter
73
- def remote(self, remote):
74
- """Sets the remote of this RepositorySyncURL.
65
+ excluded_fields: Set[str] = set([
66
+ ])
75
67
 
76
- A remote to sync from. This will override a remote set on repository. # noqa: E501
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
77
74
 
78
- :param remote: The remote of this RepositorySyncURL. # noqa: E501
79
- :type: str
80
- """
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of RepositorySyncURL from a dict"""
78
+ if obj is None:
79
+ return None
81
80
 
82
- self._remote = remote
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
83
 
84
- @property
85
- def mirror(self):
86
- """Gets the mirror of this RepositorySyncURL. # noqa: E501
84
+ _obj = cls.model_validate({
85
+ "remote": obj.get("remote"),
86
+ "mirror": obj.get("mirror") if obj.get("mirror") is not None else False
87
+ })
88
+ return _obj
87
89
 
88
- If ``True``, synchronization will remove all content that is not present in the remote repository. If ``False``, sync will be additive only. # noqa: E501
89
-
90
- :return: The mirror of this RepositorySyncURL. # noqa: E501
91
- :rtype: bool
92
- """
93
- return self._mirror
94
-
95
- @mirror.setter
96
- def mirror(self, mirror):
97
- """Sets the mirror of this RepositorySyncURL.
98
-
99
- If ``True``, synchronization will remove all content that is not present in the remote repository. If ``False``, sync will be additive only. # noqa: E501
100
-
101
- :param mirror: The mirror of this RepositorySyncURL. # noqa: E501
102
- :type: bool
103
- """
104
90
 
105
- self._mirror = mirror
106
-
107
- def to_dict(self):
108
- """Returns the model properties as a dict"""
109
- result = {}
110
-
111
- for attr, _ in six.iteritems(self.openapi_types):
112
- value = getattr(self, attr)
113
- if isinstance(value, list):
114
- result[attr] = list(map(
115
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
116
- value
117
- ))
118
- elif hasattr(value, "to_dict"):
119
- result[attr] = value.to_dict()
120
- elif isinstance(value, dict):
121
- result[attr] = dict(map(
122
- lambda item: (item[0], item[1].to_dict())
123
- if hasattr(item[1], "to_dict") else item,
124
- value.items()
125
- ))
126
- else:
127
- result[attr] = value
128
-
129
- return result
130
-
131
- def to_str(self):
132
- """Returns the string representation of the model"""
133
- return pprint.pformat(self.to_dict())
134
-
135
- def __repr__(self):
136
- """For `print` and `pprint`"""
137
- return self.to_str()
138
-
139
- def __eq__(self, other):
140
- """Returns true if both objects are equal"""
141
- if not isinstance(other, RepositorySyncURL):
142
- return False
143
-
144
- return self.to_dict() == other.to_dict()
145
-
146
- def __ne__(self, other):
147
- """Returns true if both objects are not equal"""
148
- if not isinstance(other, RepositorySyncURL):
149
- return True
150
-
151
- return self.to_dict() != other.to_dict()