crc-pulp-npm-client 20250819.1__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (86) hide show
  1. crc-pulp_npm-client/__init__.py +2 -0
  2. crc-pulp_npm-client/api/__init__.py +9 -0
  3. crc-pulp_npm-client/api/content_packages_api.py +1964 -0
  4. crc-pulp_npm-client/api/distributions_npm_api.py +2934 -0
  5. crc-pulp_npm-client/api/remotes_npm_api.py +2962 -0
  6. crc-pulp_npm-client/api/repositories_npm_api.py +3604 -0
  7. crc-pulp_npm-client/api/repositories_npm_versions_api.py +1670 -0
  8. crc-pulp_npm-client/api_client.py +798 -0
  9. crc-pulp_npm-client/api_response.py +21 -0
  10. crc-pulp_npm-client/configuration.py +628 -0
  11. crc-pulp_npm-client/exceptions.py +200 -0
  12. crc-pulp_npm-client/models/__init__.py +44 -0
  13. crc-pulp_npm-client/models/async_operation_response.py +88 -0
  14. crc-pulp_npm-client/models/content_summary_response.py +92 -0
  15. crc-pulp_npm-client/models/npm_npm_distribution.py +116 -0
  16. crc-pulp_npm-client/models/npm_npm_distribution_response.py +140 -0
  17. crc-pulp_npm-client/models/npm_npm_remote.py +205 -0
  18. crc-pulp_npm-client/models/npm_npm_remote_response.py +199 -0
  19. crc-pulp_npm-client/models/npm_npm_remote_response_hidden_fields_inner.py +90 -0
  20. crc-pulp_npm-client/models/npm_npm_repository.py +112 -0
  21. crc-pulp_npm-client/models/npm_npm_repository_response.py +137 -0
  22. crc-pulp_npm-client/models/npm_package_response.py +113 -0
  23. crc-pulp_npm-client/models/paginated_repository_version_response_list.py +112 -0
  24. crc-pulp_npm-client/models/paginatednpm_npm_distribution_response_list.py +112 -0
  25. crc-pulp_npm-client/models/paginatednpm_npm_remote_response_list.py +112 -0
  26. crc-pulp_npm-client/models/paginatednpm_npm_repository_response_list.py +112 -0
  27. crc-pulp_npm-client/models/paginatednpm_package_response_list.py +112 -0
  28. crc-pulp_npm-client/models/patchednpm_npm_distribution.py +116 -0
  29. crc-pulp_npm-client/models/patchednpm_npm_remote.py +205 -0
  30. crc-pulp_npm-client/models/patchednpm_npm_repository.py +112 -0
  31. crc-pulp_npm-client/models/policy_enum.py +39 -0
  32. crc-pulp_npm-client/models/repair.py +88 -0
  33. crc-pulp_npm-client/models/repository_add_remove_content.py +93 -0
  34. crc-pulp_npm-client/models/repository_sync_url.py +90 -0
  35. crc-pulp_npm-client/models/repository_version_response.py +121 -0
  36. crc-pulp_npm-client/models/set_label.py +103 -0
  37. crc-pulp_npm-client/models/set_label_response.py +103 -0
  38. crc-pulp_npm-client/models/unset_label.py +96 -0
  39. crc-pulp_npm-client/models/unset_label_response.py +100 -0
  40. crc-pulp_npm-client/py.typed +0 -0
  41. crc-pulp_npm-client/rest.py +258 -0
  42. crc_pulp_npm_client-20250819.1.dist-info/METADATA +25 -0
  43. crc_pulp_npm_client-20250819.1.dist-info/RECORD +86 -0
  44. crc_pulp_npm_client-20250819.1.dist-info/WHEEL +5 -0
  45. crc_pulp_npm_client-20250819.1.dist-info/top_level.txt +2 -0
  46. services-pulp_npm-client/__init__.py +2 -0
  47. services-pulp_npm-client/api/__init__.py +9 -0
  48. services-pulp_npm-client/api/content_packages_api.py +1964 -0
  49. services-pulp_npm-client/api/distributions_npm_api.py +2934 -0
  50. services-pulp_npm-client/api/remotes_npm_api.py +2962 -0
  51. services-pulp_npm-client/api/repositories_npm_api.py +3604 -0
  52. services-pulp_npm-client/api/repositories_npm_versions_api.py +1670 -0
  53. services-pulp_npm-client/api_client.py +798 -0
  54. services-pulp_npm-client/api_response.py +21 -0
  55. services-pulp_npm-client/configuration.py +628 -0
  56. services-pulp_npm-client/exceptions.py +200 -0
  57. services-pulp_npm-client/models/__init__.py +44 -0
  58. services-pulp_npm-client/models/async_operation_response.py +88 -0
  59. services-pulp_npm-client/models/content_summary_response.py +92 -0
  60. services-pulp_npm-client/models/npm_npm_distribution.py +116 -0
  61. services-pulp_npm-client/models/npm_npm_distribution_response.py +140 -0
  62. services-pulp_npm-client/models/npm_npm_remote.py +205 -0
  63. services-pulp_npm-client/models/npm_npm_remote_response.py +199 -0
  64. services-pulp_npm-client/models/npm_npm_remote_response_hidden_fields_inner.py +90 -0
  65. services-pulp_npm-client/models/npm_npm_repository.py +112 -0
  66. services-pulp_npm-client/models/npm_npm_repository_response.py +137 -0
  67. services-pulp_npm-client/models/npm_package_response.py +113 -0
  68. services-pulp_npm-client/models/paginated_repository_version_response_list.py +112 -0
  69. services-pulp_npm-client/models/paginatednpm_npm_distribution_response_list.py +112 -0
  70. services-pulp_npm-client/models/paginatednpm_npm_remote_response_list.py +112 -0
  71. services-pulp_npm-client/models/paginatednpm_npm_repository_response_list.py +112 -0
  72. services-pulp_npm-client/models/paginatednpm_package_response_list.py +112 -0
  73. services-pulp_npm-client/models/patchednpm_npm_distribution.py +116 -0
  74. services-pulp_npm-client/models/patchednpm_npm_remote.py +205 -0
  75. services-pulp_npm-client/models/patchednpm_npm_repository.py +112 -0
  76. services-pulp_npm-client/models/policy_enum.py +39 -0
  77. services-pulp_npm-client/models/repair.py +88 -0
  78. services-pulp_npm-client/models/repository_add_remove_content.py +93 -0
  79. services-pulp_npm-client/models/repository_sync_url.py +90 -0
  80. services-pulp_npm-client/models/repository_version_response.py +121 -0
  81. services-pulp_npm-client/models/set_label.py +103 -0
  82. services-pulp_npm-client/models/set_label_response.py +103 -0
  83. services-pulp_npm-client/models/unset_label.py +96 -0
  84. services-pulp_npm-client/models/unset_label_response.py +100 -0
  85. services-pulp_npm-client/py.typed +0 -0
  86. services-pulp_npm-client/rest.py +258 -0
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Pulp 3 API
5
+
6
+ Fetch, Upload, Organize, and Distribute Software Packages
7
+
8
+ The version of the OpenAPI document: v3
9
+ Contact: pulp-list@redhat.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, field_validator
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class UnsetLabel(BaseModel):
28
+ """
29
+ Serializer for synchronously UNsetting a label.
30
+ """ # noqa: E501
31
+ key: Annotated[str, Field(min_length=1, strict=True)]
32
+ __properties: ClassVar[List[str]] = ["key"]
33
+
34
+ @field_validator('key')
35
+ def key_validate_regular_expression(cls, value):
36
+ """Validates the regular expression"""
37
+ if not re.match(r"^[-a-zA-Z0-9_]+$", value):
38
+ raise ValueError(r"must validate the regular expression /^[-a-zA-Z0-9_]+$/")
39
+ return value
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 UnsetLabel 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
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of UnsetLabel from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "key": obj.get("key")
93
+ })
94
+ return _obj
95
+
96
+
@@ -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, StrictStr, field_validator
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 UnsetLabelResponse(BaseModel):
28
+ """
29
+ Serializer for synchronously UNsetting a label.
30
+ """ # noqa: E501
31
+ key: Annotated[str, Field(strict=True)]
32
+ value: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["key", "value"]
34
+
35
+ @field_validator('key')
36
+ def key_validate_regular_expression(cls, value):
37
+ """Validates the regular expression"""
38
+ if not re.match(r"^[-a-zA-Z0-9_]+$", value):
39
+ raise ValueError(r"must validate the regular expression /^[-a-zA-Z0-9_]+$/")
40
+ return value
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 UnsetLabelResponse 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
+ """
74
+ excluded_fields: Set[str] = set([
75
+ "value",
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of UnsetLabelResponse from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "key": obj.get("key"),
96
+ "value": obj.get("value")
97
+ })
98
+ return _obj
99
+
100
+
File without changes
@@ -0,0 +1,258 @@
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 services-pulp_npm-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)