crc-pulp-file-client 20250819.1__py3-none-any.whl → 20260113.4__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.
Files changed (120) hide show
  1. crc_pulp_file_client-20260113.4.dist-info/METADATA +8160 -0
  2. crc_pulp_file_client-20260113.4.dist-info/RECORD +62 -0
  3. crc_pulp_file_client-20260113.4.dist-info/top_level.txt +1 -0
  4. pulpcore/client/pulp_file/__init__.py +80 -0
  5. pulpcore/client/pulp_file/api/__init__.py +11 -0
  6. {services-pulp_file-client → pulpcore/client/pulp_file}/api/acs_file_api.py +30 -24
  7. {services-pulp_file-client → pulpcore/client/pulp_file}/api/content_files_api.py +394 -10
  8. {services-pulp_file-client → pulpcore/client/pulp_file}/api/distributions_file_api.py +33 -27
  9. {services-pulp_file-client → pulpcore/client/pulp_file}/api/publications_file_api.py +12 -12
  10. {services-pulp_file-client → pulpcore/client/pulp_file}/api/remotes_file_api.py +33 -27
  11. {services-pulp_file-client → pulpcore/client/pulp_file}/api/repositories_file_api.py +35 -29
  12. {services-pulp_file-client → pulpcore/client/pulp_file}/api/repositories_file_versions_api.py +8 -8
  13. {services-pulp_file-client → pulpcore/client/pulp_file}/api_client.py +7 -7
  14. {crc-pulp_file-client → pulpcore/client/pulp_file}/configuration.py +6 -6
  15. pulpcore/client/pulp_file/models/__init__.py +57 -0
  16. services-pulp_file-client/models/file_file_content_response.py → pulpcore/client/pulp_file/models/file_content_upload_response.py +8 -4
  17. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_content_response.py +5 -1
  18. {services-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_remote.py +1 -1
  19. {services-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_remote_response.py +2 -2
  20. {services-pulp_file-client → pulpcore/client/pulp_file}/models/object_roles_response.py +1 -1
  21. {services-pulp_file-client → pulpcore/client/pulp_file}/models/paginated_repository_version_response_list.py +1 -1
  22. {services-pulp_file-client → pulpcore/client/pulp_file}/models/paginatedfile_file_alternate_content_source_response_list.py +1 -1
  23. {services-pulp_file-client → pulpcore/client/pulp_file}/models/paginatedfile_file_content_response_list.py +1 -1
  24. {services-pulp_file-client → pulpcore/client/pulp_file}/models/paginatedfile_file_distribution_response_list.py +1 -1
  25. {services-pulp_file-client → pulpcore/client/pulp_file}/models/paginatedfile_file_publication_response_list.py +1 -1
  26. {services-pulp_file-client → pulpcore/client/pulp_file}/models/paginatedfile_file_remote_response_list.py +1 -1
  27. {services-pulp_file-client → pulpcore/client/pulp_file}/models/paginatedfile_file_repository_response_list.py +1 -1
  28. {services-pulp_file-client → pulpcore/client/pulp_file}/models/patchedfile_file_remote.py +1 -1
  29. {services-pulp_file-client → pulpcore/client/pulp_file}/models/repository_version_response.py +7 -3
  30. {services-pulp_file-client → pulpcore/client/pulp_file}/rest.py +1 -1
  31. crc-pulp_file-client/api/__init__.py +0 -11
  32. crc-pulp_file-client/api/acs_file_api.py +0 -3689
  33. crc-pulp_file-client/api/content_files_api.py +0 -2088
  34. crc-pulp_file-client/api/distributions_file_api.py +0 -4186
  35. crc-pulp_file-client/api/publications_file_api.py +0 -2881
  36. crc-pulp_file-client/api/remotes_file_api.py +0 -4214
  37. crc-pulp_file-client/api/repositories_file_api.py +0 -4856
  38. crc-pulp_file-client/api/repositories_file_versions_api.py +0 -1670
  39. crc-pulp_file-client/api_client.py +0 -798
  40. crc-pulp_file-client/models/__init__.py +0 -56
  41. crc-pulp_file-client/models/file_file_remote.py +0 -205
  42. crc-pulp_file-client/models/file_file_remote_response.py +0 -199
  43. crc-pulp_file-client/models/object_roles_response.py +0 -96
  44. crc-pulp_file-client/models/paginated_repository_version_response_list.py +0 -112
  45. crc-pulp_file-client/models/paginatedfile_file_alternate_content_source_response_list.py +0 -112
  46. crc-pulp_file-client/models/paginatedfile_file_content_response_list.py +0 -112
  47. crc-pulp_file-client/models/paginatedfile_file_distribution_response_list.py +0 -112
  48. crc-pulp_file-client/models/paginatedfile_file_publication_response_list.py +0 -112
  49. crc-pulp_file-client/models/paginatedfile_file_remote_response_list.py +0 -112
  50. crc-pulp_file-client/models/paginatedfile_file_repository_response_list.py +0 -112
  51. crc-pulp_file-client/models/patchedfile_file_remote.py +0 -205
  52. crc-pulp_file-client/models/repository_version_response.py +0 -121
  53. crc-pulp_file-client/rest.py +0 -258
  54. crc_pulp_file_client-20250819.1.dist-info/METADATA +0 -25
  55. crc_pulp_file_client-20250819.1.dist-info/RECORD +0 -114
  56. crc_pulp_file_client-20250819.1.dist-info/top_level.txt +0 -2
  57. services-pulp_file-client/api/__init__.py +0 -11
  58. services-pulp_file-client/api_response.py +0 -21
  59. services-pulp_file-client/configuration.py +0 -628
  60. services-pulp_file-client/exceptions.py +0 -200
  61. services-pulp_file-client/models/__init__.py +0 -56
  62. services-pulp_file-client/models/async_operation_response.py +0 -88
  63. services-pulp_file-client/models/content_summary_response.py +0 -92
  64. services-pulp_file-client/models/file_file_alternate_content_source.py +0 -101
  65. services-pulp_file-client/models/file_file_alternate_content_source_response.py +0 -116
  66. services-pulp_file-client/models/file_file_distribution.py +0 -118
  67. services-pulp_file-client/models/file_file_distribution_response.py +0 -142
  68. services-pulp_file-client/models/file_file_publication.py +0 -100
  69. services-pulp_file-client/models/file_file_publication_response.py +0 -120
  70. services-pulp_file-client/models/file_file_remote_response_hidden_fields_inner.py +0 -90
  71. services-pulp_file-client/models/file_file_repository.py +0 -121
  72. services-pulp_file-client/models/file_file_repository_response.py +0 -146
  73. services-pulp_file-client/models/my_permissions_response.py +0 -88
  74. services-pulp_file-client/models/nested_role.py +0 -93
  75. services-pulp_file-client/models/nested_role_response.py +0 -92
  76. services-pulp_file-client/models/patchedfile_file_alternate_content_source.py +0 -101
  77. services-pulp_file-client/models/patchedfile_file_distribution.py +0 -118
  78. services-pulp_file-client/models/patchedfile_file_repository.py +0 -121
  79. services-pulp_file-client/models/policy_enum.py +0 -39
  80. services-pulp_file-client/models/repair.py +0 -88
  81. services-pulp_file-client/models/repository_add_remove_content.py +0 -93
  82. services-pulp_file-client/models/repository_sync_url.py +0 -90
  83. services-pulp_file-client/models/set_label.py +0 -103
  84. services-pulp_file-client/models/set_label_response.py +0 -103
  85. services-pulp_file-client/models/task_group_operation_response.py +0 -88
  86. services-pulp_file-client/models/unset_label.py +0 -96
  87. services-pulp_file-client/models/unset_label_response.py +0 -100
  88. services-pulp_file-client/py.typed +0 -0
  89. {crc_pulp_file_client-20250819.1.dist-info → crc_pulp_file_client-20260113.4.dist-info}/WHEEL +0 -0
  90. {crc-pulp_file-client → pulpcore}/__init__.py +0 -0
  91. {services-pulp_file-client → pulpcore/client}/__init__.py +0 -0
  92. {crc-pulp_file-client → pulpcore/client/pulp_file}/api_response.py +0 -0
  93. {crc-pulp_file-client → pulpcore/client/pulp_file}/exceptions.py +0 -0
  94. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/async_operation_response.py +0 -0
  95. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/content_summary_response.py +0 -0
  96. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_alternate_content_source.py +0 -0
  97. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_alternate_content_source_response.py +0 -0
  98. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_distribution.py +0 -0
  99. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_distribution_response.py +0 -0
  100. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_publication.py +0 -0
  101. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_publication_response.py +0 -0
  102. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_remote_response_hidden_fields_inner.py +0 -0
  103. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_repository.py +0 -0
  104. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/file_file_repository_response.py +0 -0
  105. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/my_permissions_response.py +0 -0
  106. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/nested_role.py +0 -0
  107. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/nested_role_response.py +0 -0
  108. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/patchedfile_file_alternate_content_source.py +0 -0
  109. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/patchedfile_file_distribution.py +0 -0
  110. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/patchedfile_file_repository.py +0 -0
  111. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/policy_enum.py +0 -0
  112. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/repair.py +0 -0
  113. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/repository_add_remove_content.py +0 -0
  114. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/repository_sync_url.py +0 -0
  115. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/set_label.py +0 -0
  116. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/set_label_response.py +0 -0
  117. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/task_group_operation_response.py +0 -0
  118. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/unset_label.py +0 -0
  119. {crc-pulp_file-client → pulpcore/client/pulp_file}/models/unset_label_response.py +0 -0
  120. {crc-pulp_file-client → pulpcore/client/pulp_file}/py.typed +0 -0
@@ -1,205 +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, StrictBool, StrictInt, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional, Union
23
- from typing_extensions import Annotated
24
- from crc-pulp_file-client.models.policy_enum import PolicyEnum
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
- class PatchedfileFileRemote(BaseModel):
29
- """
30
- Serializer for File Remotes.
31
- """ # noqa: E501
32
- name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A unique name for this remote.")
33
- url: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The URL of an external content source.")
34
- ca_cert: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A PEM encoded CA certificate used to validate the server certificate presented by the remote server.")
35
- client_cert: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A PEM encoded client certificate used for authentication.")
36
- client_key: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A PEM encoded private key used for authentication.")
37
- tls_validation: Optional[StrictBool] = Field(default=None, description="If True, TLS peer validation must be performed.")
38
- proxy_url: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The proxy URL. Format: scheme://host:port")
39
- proxy_username: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The username to authenticte to the proxy.")
40
- proxy_password: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The password to authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.")
41
- username: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The username to be used for authentication when syncing.")
42
- password: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.")
43
- pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
44
- download_concurrency: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Total number of simultaneous connections. If not set then the default value will be used.")
45
- max_retries: Optional[StrictInt] = Field(default=None, description="Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.")
46
- policy: Optional[PolicyEnum] = Field(default=None, description="The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'streamed'. 'immediate' is the default. * `immediate` - When syncing, download all metadata and content now. * `on_demand` - When syncing, download metadata, but do not download content now. Instead, download content as clients request it, and save it in Pulp to be served for future client requests. * `streamed` - When syncing, download metadata, but do not download content now. Instead,download content as clients request it, but never save it in Pulp. This causes future requests for that same content to have to be downloaded again.")
47
- total_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.")
48
- connect_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.")
49
- sock_connect_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.")
50
- sock_read_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="aiohttp.ClientTimeout.sock_read (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.")
51
- headers: Optional[List[Dict[str, Any]]] = Field(default=None, description="Headers for aiohttp.Clientsession")
52
- rate_limit: Optional[StrictInt] = Field(default=None, description="Limits requests per second for each concurrent downloader")
53
- __properties: ClassVar[List[str]] = ["name", "url", "ca_cert", "client_cert", "client_key", "tls_validation", "proxy_url", "proxy_username", "proxy_password", "username", "password", "pulp_labels", "download_concurrency", "max_retries", "policy", "total_timeout", "connect_timeout", "sock_connect_timeout", "sock_read_timeout", "headers", "rate_limit"]
54
-
55
- model_config = ConfigDict(
56
- populate_by_name=True,
57
- validate_assignment=True,
58
- protected_namespaces=(),
59
- )
60
-
61
-
62
- def to_str(self) -> str:
63
- """Returns the string representation of the model using alias"""
64
- return pprint.pformat(self.model_dump(by_alias=True))
65
-
66
- def to_json(self) -> str:
67
- """Returns the JSON representation of the model using alias"""
68
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
- return json.dumps(self.to_dict())
70
-
71
- @classmethod
72
- def from_json(cls, json_str: str) -> Optional[Self]:
73
- """Create an instance of PatchedfileFileRemote from a JSON string"""
74
- return cls.from_dict(json.loads(json_str))
75
-
76
- def to_dict(self) -> Dict[str, Any]:
77
- """Return the dictionary representation of the model using alias.
78
-
79
- This has the following differences from calling pydantic's
80
- `self.model_dump(by_alias=True)`:
81
-
82
- * `None` is only added to the output dict for nullable fields that
83
- were set at model initialization. Other fields with value `None`
84
- are ignored.
85
- """
86
- excluded_fields: Set[str] = set([
87
- ])
88
-
89
- _dict = self.model_dump(
90
- by_alias=True,
91
- exclude=excluded_fields,
92
- exclude_none=True,
93
- )
94
- # set to None if ca_cert (nullable) is None
95
- # and model_fields_set contains the field
96
- if self.ca_cert is None and "ca_cert" in self.model_fields_set:
97
- _dict['ca_cert'] = None
98
-
99
- # set to None if client_cert (nullable) is None
100
- # and model_fields_set contains the field
101
- if self.client_cert is None and "client_cert" in self.model_fields_set:
102
- _dict['client_cert'] = None
103
-
104
- # set to None if client_key (nullable) is None
105
- # and model_fields_set contains the field
106
- if self.client_key is None and "client_key" in self.model_fields_set:
107
- _dict['client_key'] = None
108
-
109
- # set to None if proxy_url (nullable) is None
110
- # and model_fields_set contains the field
111
- if self.proxy_url is None and "proxy_url" in self.model_fields_set:
112
- _dict['proxy_url'] = None
113
-
114
- # set to None if proxy_username (nullable) is None
115
- # and model_fields_set contains the field
116
- if self.proxy_username is None and "proxy_username" in self.model_fields_set:
117
- _dict['proxy_username'] = None
118
-
119
- # set to None if proxy_password (nullable) is None
120
- # and model_fields_set contains the field
121
- if self.proxy_password is None and "proxy_password" in self.model_fields_set:
122
- _dict['proxy_password'] = None
123
-
124
- # set to None if username (nullable) is None
125
- # and model_fields_set contains the field
126
- if self.username is None and "username" in self.model_fields_set:
127
- _dict['username'] = None
128
-
129
- # set to None if password (nullable) is None
130
- # and model_fields_set contains the field
131
- if self.password is None and "password" in self.model_fields_set:
132
- _dict['password'] = None
133
-
134
- # set to None if download_concurrency (nullable) is None
135
- # and model_fields_set contains the field
136
- if self.download_concurrency is None and "download_concurrency" in self.model_fields_set:
137
- _dict['download_concurrency'] = None
138
-
139
- # set to None if max_retries (nullable) is None
140
- # and model_fields_set contains the field
141
- if self.max_retries is None and "max_retries" in self.model_fields_set:
142
- _dict['max_retries'] = None
143
-
144
- # set to None if total_timeout (nullable) is None
145
- # and model_fields_set contains the field
146
- if self.total_timeout is None and "total_timeout" in self.model_fields_set:
147
- _dict['total_timeout'] = None
148
-
149
- # set to None if connect_timeout (nullable) is None
150
- # and model_fields_set contains the field
151
- if self.connect_timeout is None and "connect_timeout" in self.model_fields_set:
152
- _dict['connect_timeout'] = None
153
-
154
- # set to None if sock_connect_timeout (nullable) is None
155
- # and model_fields_set contains the field
156
- if self.sock_connect_timeout is None and "sock_connect_timeout" in self.model_fields_set:
157
- _dict['sock_connect_timeout'] = None
158
-
159
- # set to None if sock_read_timeout (nullable) is None
160
- # and model_fields_set contains the field
161
- if self.sock_read_timeout is None and "sock_read_timeout" in self.model_fields_set:
162
- _dict['sock_read_timeout'] = None
163
-
164
- # set to None if rate_limit (nullable) is None
165
- # and model_fields_set contains the field
166
- if self.rate_limit is None and "rate_limit" in self.model_fields_set:
167
- _dict['rate_limit'] = None
168
-
169
- return _dict
170
-
171
- @classmethod
172
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
173
- """Create an instance of PatchedfileFileRemote from a dict"""
174
- if obj is None:
175
- return None
176
-
177
- if not isinstance(obj, dict):
178
- return cls.model_validate(obj)
179
-
180
- _obj = cls.model_validate({
181
- "name": obj.get("name"),
182
- "url": obj.get("url"),
183
- "ca_cert": obj.get("ca_cert"),
184
- "client_cert": obj.get("client_cert"),
185
- "client_key": obj.get("client_key"),
186
- "tls_validation": obj.get("tls_validation"),
187
- "proxy_url": obj.get("proxy_url"),
188
- "proxy_username": obj.get("proxy_username"),
189
- "proxy_password": obj.get("proxy_password"),
190
- "username": obj.get("username"),
191
- "password": obj.get("password"),
192
- "pulp_labels": obj.get("pulp_labels"),
193
- "download_concurrency": obj.get("download_concurrency"),
194
- "max_retries": obj.get("max_retries"),
195
- "policy": obj.get("policy"),
196
- "total_timeout": obj.get("total_timeout"),
197
- "connect_timeout": obj.get("connect_timeout"),
198
- "sock_connect_timeout": obj.get("sock_connect_timeout"),
199
- "sock_read_timeout": obj.get("sock_read_timeout"),
200
- "headers": obj.get("headers"),
201
- "rate_limit": obj.get("rate_limit")
202
- })
203
- return _obj
204
-
205
-
@@ -1,121 +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, StrictInt, StrictStr
23
- from typing import Any, ClassVar, Dict, List, Optional
24
- from crc-pulp_file-client.models.content_summary_response import ContentSummaryResponse
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
- class RepositoryVersionResponse(BaseModel):
29
- """
30
- 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.
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
- number: Optional[StrictInt] = None
37
- repository: Optional[StrictStr] = None
38
- base_version: Optional[StrictStr] = Field(default=None, description="A repository version whose content was used as the initial set of content for this repository version")
39
- content_summary: Optional[ContentSummaryResponse] = Field(default=None, description="Various count summaries of the content in the version and the HREF to view them.")
40
- __properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "number", "repository", "base_version", "content_summary"]
41
-
42
- model_config = ConfigDict(
43
- populate_by_name=True,
44
- validate_assignment=True,
45
- protected_namespaces=(),
46
- )
47
-
48
-
49
- def to_str(self) -> str:
50
- """Returns the string representation of the model using alias"""
51
- return pprint.pformat(self.model_dump(by_alias=True))
52
-
53
- def to_json(self) -> str:
54
- """Returns the JSON representation of the model using alias"""
55
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
- return json.dumps(self.to_dict())
57
-
58
- @classmethod
59
- def from_json(cls, json_str: str) -> Optional[Self]:
60
- """Create an instance of RepositoryVersionResponse from a JSON string"""
61
- return cls.from_dict(json.loads(json_str))
62
-
63
- def to_dict(self) -> Dict[str, Any]:
64
- """Return the dictionary representation of the model using alias.
65
-
66
- This has the following differences from calling pydantic's
67
- `self.model_dump(by_alias=True)`:
68
-
69
- * `None` is only added to the output dict for nullable fields that
70
- were set at model initialization. Other fields with value `None`
71
- are ignored.
72
- * OpenAPI `readOnly` fields are excluded.
73
- * OpenAPI `readOnly` fields are excluded.
74
- * OpenAPI `readOnly` fields are excluded.
75
- * OpenAPI `readOnly` fields are excluded.
76
- * OpenAPI `readOnly` fields are excluded.
77
- * OpenAPI `readOnly` fields are excluded.
78
- * OpenAPI `readOnly` fields are excluded.
79
- """
80
- excluded_fields: Set[str] = set([
81
- "pulp_href",
82
- "prn",
83
- "pulp_created",
84
- "pulp_last_updated",
85
- "number",
86
- "repository",
87
- "content_summary",
88
- ])
89
-
90
- _dict = self.model_dump(
91
- by_alias=True,
92
- exclude=excluded_fields,
93
- exclude_none=True,
94
- )
95
- # override the default output from pydantic by calling `to_dict()` of content_summary
96
- if self.content_summary:
97
- _dict['content_summary'] = self.content_summary.to_dict()
98
- return _dict
99
-
100
- @classmethod
101
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102
- """Create an instance of RepositoryVersionResponse from a dict"""
103
- if obj is None:
104
- return None
105
-
106
- if not isinstance(obj, dict):
107
- return cls.model_validate(obj)
108
-
109
- _obj = cls.model_validate({
110
- "pulp_href": obj.get("pulp_href"),
111
- "prn": obj.get("prn"),
112
- "pulp_created": obj.get("pulp_created"),
113
- "pulp_last_updated": obj.get("pulp_last_updated"),
114
- "number": obj.get("number"),
115
- "repository": obj.get("repository"),
116
- "base_version": obj.get("base_version"),
117
- "content_summary": ContentSummaryResponse.from_dict(obj["content_summary"]) if obj.get("content_summary") is not None else None
118
- })
119
- return _obj
120
-
121
-
@@ -1,258 +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
- import io
17
- import json
18
- import re
19
- import ssl
20
-
21
- import urllib3
22
-
23
- from crc-pulp_file-client.exceptions import ApiException, ApiValueError
24
-
25
- SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
26
- RESTResponseType = urllib3.HTTPResponse
27
-
28
-
29
- def is_socks_proxy_url(url):
30
- if url is None:
31
- return False
32
- split_section = url.split("://")
33
- if len(split_section) < 2:
34
- return False
35
- else:
36
- return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
37
-
38
-
39
- class RESTResponse(io.IOBase):
40
-
41
- def __init__(self, resp) -> None:
42
- self.response = resp
43
- self.status = resp.status
44
- self.reason = resp.reason
45
- self.data = None
46
-
47
- def read(self):
48
- if self.data is None:
49
- self.data = self.response.data
50
- return self.data
51
-
52
- def getheaders(self):
53
- """Returns a dictionary of the response headers."""
54
- return self.response.headers
55
-
56
- def getheader(self, name, default=None):
57
- """Returns a given response header."""
58
- return self.response.headers.get(name, default)
59
-
60
-
61
- class RESTClientObject:
62
-
63
- def __init__(self, configuration) -> None:
64
- # urllib3.PoolManager will pass all kw parameters to connectionpool
65
- # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
66
- # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
67
- # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
68
-
69
- # cert_reqs
70
- if configuration.verify_ssl:
71
- cert_reqs = ssl.CERT_REQUIRED
72
- else:
73
- cert_reqs = ssl.CERT_NONE
74
-
75
- pool_args = {
76
- "cert_reqs": cert_reqs,
77
- "ca_certs": configuration.ssl_ca_cert,
78
- "cert_file": configuration.cert_file,
79
- "key_file": configuration.key_file,
80
- }
81
- if configuration.assert_hostname is not None:
82
- pool_args['assert_hostname'] = (
83
- configuration.assert_hostname
84
- )
85
-
86
- if configuration.retries is not None:
87
- pool_args['retries'] = configuration.retries
88
-
89
- if configuration.tls_server_name:
90
- pool_args['server_hostname'] = configuration.tls_server_name
91
-
92
-
93
- if configuration.socket_options is not None:
94
- pool_args['socket_options'] = configuration.socket_options
95
-
96
- if configuration.connection_pool_maxsize is not None:
97
- pool_args['maxsize'] = configuration.connection_pool_maxsize
98
-
99
- # https pool manager
100
- self.pool_manager: urllib3.PoolManager
101
-
102
- if configuration.proxy:
103
- if is_socks_proxy_url(configuration.proxy):
104
- from urllib3.contrib.socks import SOCKSProxyManager
105
- pool_args["proxy_url"] = configuration.proxy
106
- pool_args["headers"] = configuration.proxy_headers
107
- self.pool_manager = SOCKSProxyManager(**pool_args)
108
- else:
109
- pool_args["proxy_url"] = configuration.proxy
110
- pool_args["proxy_headers"] = configuration.proxy_headers
111
- self.pool_manager = urllib3.ProxyManager(**pool_args)
112
- else:
113
- self.pool_manager = urllib3.PoolManager(**pool_args)
114
-
115
- def request(
116
- self,
117
- method,
118
- url,
119
- headers=None,
120
- body=None,
121
- post_params=None,
122
- _request_timeout=None
123
- ):
124
- """Perform requests.
125
-
126
- :param method: http request method
127
- :param url: http request url
128
- :param headers: http request headers
129
- :param body: request json body, for `application/json`
130
- :param post_params: request post parameters,
131
- `application/x-www-form-urlencoded`
132
- and `multipart/form-data`
133
- :param _request_timeout: timeout setting for this request. If one
134
- number provided, it will be total request
135
- timeout. It can also be a pair (tuple) of
136
- (connection, read) timeouts.
137
- """
138
- method = method.upper()
139
- assert method in [
140
- 'GET',
141
- 'HEAD',
142
- 'DELETE',
143
- 'POST',
144
- 'PUT',
145
- 'PATCH',
146
- 'OPTIONS'
147
- ]
148
-
149
- if post_params and body:
150
- raise ApiValueError(
151
- "body parameter cannot be used with post_params parameter."
152
- )
153
-
154
- post_params = post_params or {}
155
- headers = headers or {}
156
-
157
- timeout = None
158
- if _request_timeout:
159
- if isinstance(_request_timeout, (int, float)):
160
- timeout = urllib3.Timeout(total=_request_timeout)
161
- elif (
162
- isinstance(_request_timeout, tuple)
163
- and len(_request_timeout) == 2
164
- ):
165
- timeout = urllib3.Timeout(
166
- connect=_request_timeout[0],
167
- read=_request_timeout[1]
168
- )
169
-
170
- try:
171
- # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
172
- if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
173
-
174
- # no content type provided or payload is json
175
- content_type = headers.get('Content-Type')
176
- if (
177
- not content_type
178
- or re.search('json', content_type, re.IGNORECASE)
179
- ):
180
- request_body = None
181
- if body is not None:
182
- request_body = json.dumps(body)
183
- r = self.pool_manager.request(
184
- method,
185
- url,
186
- body=request_body,
187
- timeout=timeout,
188
- headers=headers,
189
- preload_content=False
190
- )
191
- elif content_type == 'application/x-www-form-urlencoded':
192
- r = self.pool_manager.request(
193
- method,
194
- url,
195
- fields=post_params,
196
- encode_multipart=False,
197
- timeout=timeout,
198
- headers=headers,
199
- preload_content=False
200
- )
201
- elif content_type == 'multipart/form-data':
202
- # must del headers['Content-Type'], or the correct
203
- # Content-Type which generated by urllib3 will be
204
- # overwritten.
205
- del headers['Content-Type']
206
- # Ensures that dict objects are serialized
207
- post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
208
- r = self.pool_manager.request(
209
- method,
210
- url,
211
- fields=post_params,
212
- encode_multipart=True,
213
- timeout=timeout,
214
- headers=headers,
215
- preload_content=False
216
- )
217
- # Pass a `string` parameter directly in the body to support
218
- # other content types than JSON when `body` argument is
219
- # provided in serialized form.
220
- elif isinstance(body, str) or isinstance(body, bytes):
221
- r = self.pool_manager.request(
222
- method,
223
- url,
224
- body=body,
225
- timeout=timeout,
226
- headers=headers,
227
- preload_content=False
228
- )
229
- elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
230
- request_body = "true" if body else "false"
231
- r = self.pool_manager.request(
232
- method,
233
- url,
234
- body=request_body,
235
- preload_content=False,
236
- timeout=timeout,
237
- headers=headers)
238
- else:
239
- # Cannot generate the request from given parameters
240
- msg = """Cannot prepare a request message for provided
241
- arguments. Please check that your arguments match
242
- declared content type."""
243
- raise ApiException(status=0, reason=msg)
244
- # For `GET`, `HEAD`
245
- else:
246
- r = self.pool_manager.request(
247
- method,
248
- url,
249
- fields={},
250
- timeout=timeout,
251
- headers=headers,
252
- preload_content=False
253
- )
254
- except urllib3.exceptions.SSLError as e:
255
- msg = "\n".join([type(e).__name__, str(e)])
256
- raise ApiException(status=0, reason=msg)
257
-
258
- return RESTResponse(r)
@@ -1,25 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: crc-pulp_file-client
3
- Version: 20250819.1
4
- Summary: Pulp 3 API
5
- Home-page:
6
- Author: Pulp Team
7
- Author-email: pulp-list@redhat.com
8
- License: GPLv2+
9
- Keywords: pulp,pulpcore,client,Pulp 3 API
10
- Description-Content-Type: text/markdown
11
- Requires-Dist: urllib3<3.0.0,>=1.25.3
12
- Requires-Dist: python-dateutil<2.10.0,>=2.8.1
13
- Requires-Dist: pydantic>=2
14
- Requires-Dist: typing-extensions>=4.7.1
15
- Dynamic: author
16
- Dynamic: author-email
17
- Dynamic: description
18
- Dynamic: description-content-type
19
- Dynamic: keywords
20
- Dynamic: license
21
- Dynamic: requires-dist
22
- Dynamic: summary
23
-
24
- Fetch, Upload, Organize, and Distribute Software Packages
25
-