crc-pulp-npm-client 20250819.1__py3-none-any.whl → 20250820.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 (49) hide show
  1. crc-pulp_npm-client/api_client.py +1 -1
  2. crc-pulp_npm-client/configuration.py +3 -3
  3. {crc_pulp_npm_client-20250819.1.dist-info → crc_pulp_npm_client-20250820.1.dist-info}/METADATA +1 -1
  4. crc_pulp_npm_client-20250820.1.dist-info/RECORD +45 -0
  5. crc_pulp_npm_client-20250820.1.dist-info/top_level.txt +1 -0
  6. crc_pulp_npm_client-20250819.1.dist-info/RECORD +0 -86
  7. crc_pulp_npm_client-20250819.1.dist-info/top_level.txt +0 -2
  8. services-pulp_npm-client/__init__.py +0 -2
  9. services-pulp_npm-client/api/__init__.py +0 -9
  10. services-pulp_npm-client/api/content_packages_api.py +0 -1964
  11. services-pulp_npm-client/api/distributions_npm_api.py +0 -2934
  12. services-pulp_npm-client/api/remotes_npm_api.py +0 -2962
  13. services-pulp_npm-client/api/repositories_npm_api.py +0 -3604
  14. services-pulp_npm-client/api/repositories_npm_versions_api.py +0 -1670
  15. services-pulp_npm-client/api_client.py +0 -798
  16. services-pulp_npm-client/api_response.py +0 -21
  17. services-pulp_npm-client/configuration.py +0 -628
  18. services-pulp_npm-client/exceptions.py +0 -200
  19. services-pulp_npm-client/models/__init__.py +0 -44
  20. services-pulp_npm-client/models/async_operation_response.py +0 -88
  21. services-pulp_npm-client/models/content_summary_response.py +0 -92
  22. services-pulp_npm-client/models/npm_npm_distribution.py +0 -116
  23. services-pulp_npm-client/models/npm_npm_distribution_response.py +0 -140
  24. services-pulp_npm-client/models/npm_npm_remote.py +0 -205
  25. services-pulp_npm-client/models/npm_npm_remote_response.py +0 -199
  26. services-pulp_npm-client/models/npm_npm_remote_response_hidden_fields_inner.py +0 -90
  27. services-pulp_npm-client/models/npm_npm_repository.py +0 -112
  28. services-pulp_npm-client/models/npm_npm_repository_response.py +0 -137
  29. services-pulp_npm-client/models/npm_package_response.py +0 -113
  30. services-pulp_npm-client/models/paginated_repository_version_response_list.py +0 -112
  31. services-pulp_npm-client/models/paginatednpm_npm_distribution_response_list.py +0 -112
  32. services-pulp_npm-client/models/paginatednpm_npm_remote_response_list.py +0 -112
  33. services-pulp_npm-client/models/paginatednpm_npm_repository_response_list.py +0 -112
  34. services-pulp_npm-client/models/paginatednpm_package_response_list.py +0 -112
  35. services-pulp_npm-client/models/patchednpm_npm_distribution.py +0 -116
  36. services-pulp_npm-client/models/patchednpm_npm_remote.py +0 -205
  37. services-pulp_npm-client/models/patchednpm_npm_repository.py +0 -112
  38. services-pulp_npm-client/models/policy_enum.py +0 -39
  39. services-pulp_npm-client/models/repair.py +0 -88
  40. services-pulp_npm-client/models/repository_add_remove_content.py +0 -93
  41. services-pulp_npm-client/models/repository_sync_url.py +0 -90
  42. services-pulp_npm-client/models/repository_version_response.py +0 -121
  43. services-pulp_npm-client/models/set_label.py +0 -103
  44. services-pulp_npm-client/models/set_label_response.py +0 -103
  45. services-pulp_npm-client/models/unset_label.py +0 -96
  46. services-pulp_npm-client/models/unset_label_response.py +0 -100
  47. services-pulp_npm-client/py.typed +0 -0
  48. services-pulp_npm-client/rest.py +0 -258
  49. {crc_pulp_npm_client-20250819.1.dist-info → crc_pulp_npm_client-20250820.1.dist-info}/WHEEL +0 -0
@@ -1,112 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Pulp 3 API
5
-
6
- Fetch, Upload, Organize, and Distribute Software Packages
7
-
8
- The version of the OpenAPI document: v3
9
- Contact: pulp-list@redhat.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
-
16
- from __future__ import annotations
17
- import pprint
18
- import re # noqa: F401
19
- import json
20
-
21
- from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from services-pulp_npm-client.models.npm_npm_repository_response import NpmNpmRepositoryResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class PaginatednpmNpmRepositoryResponseList(BaseModel):
28
- """
29
- PaginatednpmNpmRepositoryResponseList
30
- """ # noqa: E501
31
- count: StrictInt
32
- next: Optional[StrictStr] = None
33
- previous: Optional[StrictStr] = None
34
- results: List[NpmNpmRepositoryResponse]
35
- __properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
36
-
37
- model_config = ConfigDict(
38
- populate_by_name=True,
39
- validate_assignment=True,
40
- protected_namespaces=(),
41
- )
42
-
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of PaginatednpmNpmRepositoryResponseList from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([
69
- ])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
- _items = []
78
- if self.results:
79
- for _item_results in self.results:
80
- if _item_results:
81
- _items.append(_item_results.to_dict())
82
- _dict['results'] = _items
83
- # set to None if next (nullable) is None
84
- # and model_fields_set contains the field
85
- if self.next is None and "next" in self.model_fields_set:
86
- _dict['next'] = None
87
-
88
- # set to None if previous (nullable) is None
89
- # and model_fields_set contains the field
90
- if self.previous is None and "previous" in self.model_fields_set:
91
- _dict['previous'] = None
92
-
93
- return _dict
94
-
95
- @classmethod
96
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
- """Create an instance of PaginatednpmNpmRepositoryResponseList from a dict"""
98
- if obj is None:
99
- return None
100
-
101
- if not isinstance(obj, dict):
102
- return cls.model_validate(obj)
103
-
104
- _obj = cls.model_validate({
105
- "count": obj.get("count"),
106
- "next": obj.get("next"),
107
- "previous": obj.get("previous"),
108
- "results": [NpmNpmRepositoryResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
109
- })
110
- return _obj
111
-
112
-
@@ -1,112 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Pulp 3 API
5
-
6
- Fetch, Upload, Organize, and Distribute Software Packages
7
-
8
- The version of the OpenAPI document: v3
9
- Contact: pulp-list@redhat.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
-
16
- from __future__ import annotations
17
- import pprint
18
- import re # noqa: F401
19
- import json
20
-
21
- from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from services-pulp_npm-client.models.npm_package_response import NpmPackageResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class PaginatednpmPackageResponseList(BaseModel):
28
- """
29
- PaginatednpmPackageResponseList
30
- """ # noqa: E501
31
- count: StrictInt
32
- next: Optional[StrictStr] = None
33
- previous: Optional[StrictStr] = None
34
- results: List[NpmPackageResponse]
35
- __properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
36
-
37
- model_config = ConfigDict(
38
- populate_by_name=True,
39
- validate_assignment=True,
40
- protected_namespaces=(),
41
- )
42
-
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of PaginatednpmPackageResponseList from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([
69
- ])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
- _items = []
78
- if self.results:
79
- for _item_results in self.results:
80
- if _item_results:
81
- _items.append(_item_results.to_dict())
82
- _dict['results'] = _items
83
- # set to None if next (nullable) is None
84
- # and model_fields_set contains the field
85
- if self.next is None and "next" in self.model_fields_set:
86
- _dict['next'] = None
87
-
88
- # set to None if previous (nullable) is None
89
- # and model_fields_set contains the field
90
- if self.previous is None and "previous" in self.model_fields_set:
91
- _dict['previous'] = None
92
-
93
- return _dict
94
-
95
- @classmethod
96
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
- """Create an instance of PaginatednpmPackageResponseList from a dict"""
98
- if obj is None:
99
- return None
100
-
101
- if not isinstance(obj, dict):
102
- return cls.model_validate(obj)
103
-
104
- _obj = cls.model_validate({
105
- "count": obj.get("count"),
106
- "next": obj.get("next"),
107
- "previous": obj.get("previous"),
108
- "results": [NpmPackageResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
109
- })
110
- return _obj
111
-
112
-
@@ -1,116 +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, 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 PatchednpmNpmDistribution(BaseModel):
28
- """
29
- Serializer for NPM Distributions.
30
- """ # noqa: E501
31
- base_path: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, 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: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, 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
- remote: Optional[StrictStr] = Field(default=None, description="Remote that can be used to fetch content when using pull-through caching.")
38
- __properties: ClassVar[List[str]] = ["base_path", "content_guard", "hidden", "pulp_labels", "name", "repository", "remote"]
39
-
40
- model_config = ConfigDict(
41
- populate_by_name=True,
42
- validate_assignment=True,
43
- protected_namespaces=(),
44
- )
45
-
46
-
47
- def to_str(self) -> str:
48
- """Returns the string representation of the model using alias"""
49
- return pprint.pformat(self.model_dump(by_alias=True))
50
-
51
- def to_json(self) -> str:
52
- """Returns the JSON representation of the model using alias"""
53
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
- return json.dumps(self.to_dict())
55
-
56
- @classmethod
57
- def from_json(cls, json_str: str) -> Optional[Self]:
58
- """Create an instance of PatchednpmNpmDistribution from a JSON string"""
59
- return cls.from_dict(json.loads(json_str))
60
-
61
- def to_dict(self) -> Dict[str, Any]:
62
- """Return the dictionary representation of the model using alias.
63
-
64
- This has the following differences from calling pydantic's
65
- `self.model_dump(by_alias=True)`:
66
-
67
- * `None` is only added to the output dict for nullable fields that
68
- were set at model initialization. Other fields with value `None`
69
- are ignored.
70
- """
71
- excluded_fields: Set[str] = set([
72
- ])
73
-
74
- _dict = self.model_dump(
75
- by_alias=True,
76
- exclude=excluded_fields,
77
- exclude_none=True,
78
- )
79
- # set to None if content_guard (nullable) is None
80
- # and model_fields_set contains the field
81
- if self.content_guard is None and "content_guard" in self.model_fields_set:
82
- _dict['content_guard'] = None
83
-
84
- # set to None if repository (nullable) is None
85
- # and model_fields_set contains the field
86
- if self.repository is None and "repository" in self.model_fields_set:
87
- _dict['repository'] = None
88
-
89
- # set to None if remote (nullable) is None
90
- # and model_fields_set contains the field
91
- if self.remote is None and "remote" in self.model_fields_set:
92
- _dict['remote'] = None
93
-
94
- return _dict
95
-
96
- @classmethod
97
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
- """Create an instance of PatchednpmNpmDistribution from a dict"""
99
- if obj is None:
100
- return None
101
-
102
- if not isinstance(obj, dict):
103
- return cls.model_validate(obj)
104
-
105
- _obj = cls.model_validate({
106
- "base_path": obj.get("base_path"),
107
- "content_guard": obj.get("content_guard"),
108
- "hidden": obj.get("hidden") if obj.get("hidden") is not None else False,
109
- "pulp_labels": obj.get("pulp_labels"),
110
- "name": obj.get("name"),
111
- "repository": obj.get("repository"),
112
- "remote": obj.get("remote")
113
- })
114
- return _obj
115
-
116
-
@@ -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 services-pulp_npm-client.models.policy_enum import PolicyEnum
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
- class PatchednpmNpmRemote(BaseModel):
29
- """
30
- A Serializer for NpmRemote. Add any new fields if defined on NpmRemote. Similar to the example above, in PackageSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = core_serializers.RemoteSerializer.Meta.validators + [myValidator1, ...] By default the 'policy' field in core_serializers.RemoteSerializer only validates the choice 'immediate'. To add on-demand support for more 'policy' options, e.g. 'streamed' or 'on_demand', re-define the 'policy' option as follows::
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 PatchednpmNpmRemote 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 PatchednpmNpmRemote 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,112 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Pulp 3 API
5
-
6
- Fetch, Upload, Organize, and Distribute Software Packages
7
-
8
- The version of the OpenAPI document: v3
9
- Contact: pulp-list@redhat.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
-
16
- from __future__ import annotations
17
- import pprint
18
- import re # noqa: F401
19
- import json
20
-
21
- from pydantic import BaseModel, ConfigDict, 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
26
-
27
- class PatchednpmNpmRepository(BaseModel):
28
- """
29
- A Serializer for NpmRepository. Add any new fields if defined on NpmRepository. Similar to the example above, in PackageSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = core_serializers.RepositorySerializer.Meta.validators + [myValidator1, ...]
30
- """ # noqa: E501
31
- pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
32
- name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="A unique name for this repository.")
33
- description: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="An optional description.")
34
- retain_repo_versions: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Retain X versions of the repository. Default is null which retains all versions.")
35
- remote: Optional[StrictStr] = Field(default=None, description="An optional remote to use by default when syncing.")
36
- __properties: ClassVar[List[str]] = ["pulp_labels", "name", "description", "retain_repo_versions", "remote"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of PatchednpmNpmRepository from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([
70
- ])
71
-
72
- _dict = self.model_dump(
73
- by_alias=True,
74
- exclude=excluded_fields,
75
- exclude_none=True,
76
- )
77
- # set to None if description (nullable) is None
78
- # and model_fields_set contains the field
79
- if self.description is None and "description" in self.model_fields_set:
80
- _dict['description'] = None
81
-
82
- # set to None if retain_repo_versions (nullable) is None
83
- # and model_fields_set contains the field
84
- if self.retain_repo_versions is None and "retain_repo_versions" in self.model_fields_set:
85
- _dict['retain_repo_versions'] = None
86
-
87
- # set to None if remote (nullable) is None
88
- # and model_fields_set contains the field
89
- if self.remote is None and "remote" in self.model_fields_set:
90
- _dict['remote'] = None
91
-
92
- return _dict
93
-
94
- @classmethod
95
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96
- """Create an instance of PatchednpmNpmRepository from a dict"""
97
- if obj is None:
98
- return None
99
-
100
- if not isinstance(obj, dict):
101
- return cls.model_validate(obj)
102
-
103
- _obj = cls.model_validate({
104
- "pulp_labels": obj.get("pulp_labels"),
105
- "name": obj.get("name"),
106
- "description": obj.get("description"),
107
- "retain_repo_versions": obj.get("retain_repo_versions"),
108
- "remote": obj.get("remote")
109
- })
110
- return _obj
111
-
112
-