crc-pulp-file-client 20251209.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of crc-pulp-file-client might be problematic. Click here for more details.
- crc_pulp_file_client-20251209.2.dist-info/METADATA +8160 -0
- crc_pulp_file_client-20251209.2.dist-info/RECORD +62 -0
- crc_pulp_file_client-20251209.2.dist-info/WHEEL +5 -0
- crc_pulp_file_client-20251209.2.dist-info/top_level.txt +1 -0
- pulpcore/__init__.py +2 -0
- pulpcore/client/__init__.py +2 -0
- pulpcore/client/pulp_file/__init__.py +80 -0
- pulpcore/client/pulp_file/api/__init__.py +11 -0
- pulpcore/client/pulp_file/api/acs_file_api.py +3695 -0
- pulpcore/client/pulp_file/api/content_files_api.py +2472 -0
- pulpcore/client/pulp_file/api/distributions_file_api.py +4192 -0
- pulpcore/client/pulp_file/api/publications_file_api.py +2881 -0
- pulpcore/client/pulp_file/api/remotes_file_api.py +4220 -0
- pulpcore/client/pulp_file/api/repositories_file_api.py +4862 -0
- pulpcore/client/pulp_file/api/repositories_file_versions_api.py +1670 -0
- pulpcore/client/pulp_file/api_client.py +798 -0
- pulpcore/client/pulp_file/api_response.py +21 -0
- pulpcore/client/pulp_file/configuration.py +628 -0
- pulpcore/client/pulp_file/exceptions.py +200 -0
- pulpcore/client/pulp_file/models/__init__.py +57 -0
- pulpcore/client/pulp_file/models/async_operation_response.py +88 -0
- pulpcore/client/pulp_file/models/content_summary_response.py +92 -0
- pulpcore/client/pulp_file/models/file_content_upload_response.py +137 -0
- pulpcore/client/pulp_file/models/file_file_alternate_content_source.py +101 -0
- pulpcore/client/pulp_file/models/file_file_alternate_content_source_response.py +116 -0
- pulpcore/client/pulp_file/models/file_file_content_response.py +137 -0
- pulpcore/client/pulp_file/models/file_file_distribution.py +118 -0
- pulpcore/client/pulp_file/models/file_file_distribution_response.py +142 -0
- pulpcore/client/pulp_file/models/file_file_publication.py +100 -0
- pulpcore/client/pulp_file/models/file_file_publication_response.py +120 -0
- pulpcore/client/pulp_file/models/file_file_remote.py +205 -0
- pulpcore/client/pulp_file/models/file_file_remote_response.py +199 -0
- pulpcore/client/pulp_file/models/file_file_remote_response_hidden_fields_inner.py +90 -0
- pulpcore/client/pulp_file/models/file_file_repository.py +121 -0
- pulpcore/client/pulp_file/models/file_file_repository_response.py +146 -0
- pulpcore/client/pulp_file/models/my_permissions_response.py +88 -0
- pulpcore/client/pulp_file/models/nested_role.py +93 -0
- pulpcore/client/pulp_file/models/nested_role_response.py +92 -0
- pulpcore/client/pulp_file/models/object_roles_response.py +96 -0
- pulpcore/client/pulp_file/models/paginated_repository_version_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_alternate_content_source_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_content_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_distribution_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_publication_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_remote_response_list.py +112 -0
- pulpcore/client/pulp_file/models/paginatedfile_file_repository_response_list.py +112 -0
- pulpcore/client/pulp_file/models/patchedfile_file_alternate_content_source.py +101 -0
- pulpcore/client/pulp_file/models/patchedfile_file_distribution.py +118 -0
- pulpcore/client/pulp_file/models/patchedfile_file_remote.py +205 -0
- pulpcore/client/pulp_file/models/patchedfile_file_repository.py +121 -0
- pulpcore/client/pulp_file/models/policy_enum.py +39 -0
- pulpcore/client/pulp_file/models/repair.py +88 -0
- pulpcore/client/pulp_file/models/repository_add_remove_content.py +93 -0
- pulpcore/client/pulp_file/models/repository_sync_url.py +90 -0
- pulpcore/client/pulp_file/models/repository_version_response.py +125 -0
- pulpcore/client/pulp_file/models/set_label.py +103 -0
- pulpcore/client/pulp_file/models/set_label_response.py +103 -0
- pulpcore/client/pulp_file/models/task_group_operation_response.py +88 -0
- pulpcore/client/pulp_file/models/unset_label.py +96 -0
- pulpcore/client/pulp_file/models/unset_label_response.py +100 -0
- pulpcore/client/pulp_file/py.typed +0 -0
- pulpcore/client/pulp_file/rest.py +258 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pulp 3 API
|
|
5
|
+
|
|
6
|
+
Fetch, Upload, Organize, and Distribute Software Packages
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3
|
|
9
|
+
Contact: pulp-list@redhat.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class FileFilePublicationResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Serializer for File Publications.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
pulp_href: Optional[StrictStr] = None
|
|
32
|
+
prn: Optional[StrictStr] = Field(default=None, description="The Pulp Resource Name (PRN).")
|
|
33
|
+
pulp_created: Optional[datetime] = Field(default=None, description="Timestamp of creation.")
|
|
34
|
+
pulp_last_updated: Optional[datetime] = Field(default=None, description="Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.")
|
|
35
|
+
repository_version: Optional[StrictStr] = None
|
|
36
|
+
repository: Optional[StrictStr] = Field(default=None, description="A URI of the repository to be published.")
|
|
37
|
+
distributions: Optional[List[StrictStr]] = Field(default=None, description="This publication is currently hosted as defined by these distributions.")
|
|
38
|
+
manifest: Optional[StrictStr] = Field(default='PULP_MANIFEST', description="Filename to use for manifest file containing metadata for all the files.")
|
|
39
|
+
checkpoint: Optional[StrictBool] = None
|
|
40
|
+
__properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "repository_version", "repository", "distributions", "manifest", "checkpoint"]
|
|
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 FileFilePublicationResponse 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
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([
|
|
79
|
+
"pulp_href",
|
|
80
|
+
"prn",
|
|
81
|
+
"pulp_created",
|
|
82
|
+
"pulp_last_updated",
|
|
83
|
+
"distributions",
|
|
84
|
+
])
|
|
85
|
+
|
|
86
|
+
_dict = self.model_dump(
|
|
87
|
+
by_alias=True,
|
|
88
|
+
exclude=excluded_fields,
|
|
89
|
+
exclude_none=True,
|
|
90
|
+
)
|
|
91
|
+
# set to None if manifest (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.manifest is None and "manifest" in self.model_fields_set:
|
|
94
|
+
_dict['manifest'] = None
|
|
95
|
+
|
|
96
|
+
return _dict
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
100
|
+
"""Create an instance of FileFilePublicationResponse from a dict"""
|
|
101
|
+
if obj is None:
|
|
102
|
+
return None
|
|
103
|
+
|
|
104
|
+
if not isinstance(obj, dict):
|
|
105
|
+
return cls.model_validate(obj)
|
|
106
|
+
|
|
107
|
+
_obj = cls.model_validate({
|
|
108
|
+
"pulp_href": obj.get("pulp_href"),
|
|
109
|
+
"prn": obj.get("prn"),
|
|
110
|
+
"pulp_created": obj.get("pulp_created"),
|
|
111
|
+
"pulp_last_updated": obj.get("pulp_last_updated"),
|
|
112
|
+
"repository_version": obj.get("repository_version"),
|
|
113
|
+
"repository": obj.get("repository"),
|
|
114
|
+
"distributions": obj.get("distributions"),
|
|
115
|
+
"manifest": obj.get("manifest") if obj.get("manifest") is not None else 'PULP_MANIFEST',
|
|
116
|
+
"checkpoint": obj.get("checkpoint")
|
|
117
|
+
})
|
|
118
|
+
return _obj
|
|
119
|
+
|
|
120
|
+
|
|
@@ -0,0 +1,205 @@
|
|
|
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 pulpcore.client.pulp_file.models.policy_enum import PolicyEnum
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class FileFileRemote(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Serializer for File Remotes.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="A unique name for this remote.")
|
|
33
|
+
url: Annotated[str, Field(min_length=1, strict=True)] = Field(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 FileFileRemote 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 FileFileRemote 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
|
+
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pulp 3 API
|
|
5
|
+
|
|
6
|
+
Fetch, Upload, Organize, and Distribute Software Packages
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v3
|
|
9
|
+
Contact: pulp-list@redhat.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
from pulpcore.client.pulp_file.models.file_file_remote_response_hidden_fields_inner import FileFileRemoteResponseHiddenFieldsInner
|
|
26
|
+
from pulpcore.client.pulp_file.models.policy_enum import PolicyEnum
|
|
27
|
+
from typing import Optional, Set
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
|
|
30
|
+
class FileFileRemoteResponse(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
Serializer for File Remotes.
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
pulp_href: Optional[StrictStr] = None
|
|
35
|
+
prn: Optional[StrictStr] = Field(default=None, description="The Pulp Resource Name (PRN).")
|
|
36
|
+
pulp_created: Optional[datetime] = Field(default=None, description="Timestamp of creation.")
|
|
37
|
+
pulp_last_updated: Optional[datetime] = Field(default=None, description="Timestamp of the most recent update of the remote.")
|
|
38
|
+
name: StrictStr = Field(description="A unique name for this remote.")
|
|
39
|
+
url: StrictStr = Field(description="The URL of an external content source.")
|
|
40
|
+
ca_cert: Optional[StrictStr] = Field(default=None, description="A PEM encoded CA certificate used to validate the server certificate presented by the remote server.")
|
|
41
|
+
client_cert: Optional[StrictStr] = Field(default=None, description="A PEM encoded client certificate used for authentication.")
|
|
42
|
+
tls_validation: Optional[StrictBool] = Field(default=None, description="If True, TLS peer validation must be performed.")
|
|
43
|
+
proxy_url: Optional[StrictStr] = Field(default=None, description="The proxy URL. Format: scheme://host:port")
|
|
44
|
+
pulp_labels: Optional[Dict[str, Optional[StrictStr]]] = None
|
|
45
|
+
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.")
|
|
46
|
+
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.")
|
|
47
|
+
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.")
|
|
48
|
+
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.")
|
|
49
|
+
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.")
|
|
50
|
+
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.")
|
|
51
|
+
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.")
|
|
52
|
+
headers: Optional[List[Dict[str, Any]]] = Field(default=None, description="Headers for aiohttp.Clientsession")
|
|
53
|
+
rate_limit: Optional[StrictInt] = Field(default=None, description="Limits requests per second for each concurrent downloader")
|
|
54
|
+
hidden_fields: Optional[List[FileFileRemoteResponseHiddenFieldsInner]] = Field(default=None, description="List of hidden (write only) fields")
|
|
55
|
+
__properties: ClassVar[List[str]] = ["pulp_href", "prn", "pulp_created", "pulp_last_updated", "name", "url", "ca_cert", "client_cert", "tls_validation", "proxy_url", "pulp_labels", "download_concurrency", "max_retries", "policy", "total_timeout", "connect_timeout", "sock_connect_timeout", "sock_read_timeout", "headers", "rate_limit", "hidden_fields"]
|
|
56
|
+
|
|
57
|
+
model_config = ConfigDict(
|
|
58
|
+
populate_by_name=True,
|
|
59
|
+
validate_assignment=True,
|
|
60
|
+
protected_namespaces=(),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def to_str(self) -> str:
|
|
65
|
+
"""Returns the string representation of the model using alias"""
|
|
66
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
67
|
+
|
|
68
|
+
def to_json(self) -> str:
|
|
69
|
+
"""Returns the JSON representation of the model using alias"""
|
|
70
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
71
|
+
return json.dumps(self.to_dict())
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of FileFileRemoteResponse from a JSON string"""
|
|
76
|
+
return cls.from_dict(json.loads(json_str))
|
|
77
|
+
|
|
78
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
79
|
+
"""Return the dictionary representation of the model using alias.
|
|
80
|
+
|
|
81
|
+
This has the following differences from calling pydantic's
|
|
82
|
+
`self.model_dump(by_alias=True)`:
|
|
83
|
+
|
|
84
|
+
* `None` is only added to the output dict for nullable fields that
|
|
85
|
+
were set at model initialization. Other fields with value `None`
|
|
86
|
+
are ignored.
|
|
87
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
88
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
89
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
90
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
91
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
92
|
+
"""
|
|
93
|
+
excluded_fields: Set[str] = set([
|
|
94
|
+
"pulp_href",
|
|
95
|
+
"prn",
|
|
96
|
+
"pulp_created",
|
|
97
|
+
"pulp_last_updated",
|
|
98
|
+
"hidden_fields",
|
|
99
|
+
])
|
|
100
|
+
|
|
101
|
+
_dict = self.model_dump(
|
|
102
|
+
by_alias=True,
|
|
103
|
+
exclude=excluded_fields,
|
|
104
|
+
exclude_none=True,
|
|
105
|
+
)
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of each item in hidden_fields (list)
|
|
107
|
+
_items = []
|
|
108
|
+
if self.hidden_fields:
|
|
109
|
+
for _item_hidden_fields in self.hidden_fields:
|
|
110
|
+
if _item_hidden_fields:
|
|
111
|
+
_items.append(_item_hidden_fields.to_dict())
|
|
112
|
+
_dict['hidden_fields'] = _items
|
|
113
|
+
# set to None if ca_cert (nullable) is None
|
|
114
|
+
# and model_fields_set contains the field
|
|
115
|
+
if self.ca_cert is None and "ca_cert" in self.model_fields_set:
|
|
116
|
+
_dict['ca_cert'] = None
|
|
117
|
+
|
|
118
|
+
# set to None if client_cert (nullable) is None
|
|
119
|
+
# and model_fields_set contains the field
|
|
120
|
+
if self.client_cert is None and "client_cert" in self.model_fields_set:
|
|
121
|
+
_dict['client_cert'] = None
|
|
122
|
+
|
|
123
|
+
# set to None if proxy_url (nullable) is None
|
|
124
|
+
# and model_fields_set contains the field
|
|
125
|
+
if self.proxy_url is None and "proxy_url" in self.model_fields_set:
|
|
126
|
+
_dict['proxy_url'] = None
|
|
127
|
+
|
|
128
|
+
# set to None if download_concurrency (nullable) is None
|
|
129
|
+
# and model_fields_set contains the field
|
|
130
|
+
if self.download_concurrency is None and "download_concurrency" in self.model_fields_set:
|
|
131
|
+
_dict['download_concurrency'] = None
|
|
132
|
+
|
|
133
|
+
# set to None if max_retries (nullable) is None
|
|
134
|
+
# and model_fields_set contains the field
|
|
135
|
+
if self.max_retries is None and "max_retries" in self.model_fields_set:
|
|
136
|
+
_dict['max_retries'] = None
|
|
137
|
+
|
|
138
|
+
# set to None if total_timeout (nullable) is None
|
|
139
|
+
# and model_fields_set contains the field
|
|
140
|
+
if self.total_timeout is None and "total_timeout" in self.model_fields_set:
|
|
141
|
+
_dict['total_timeout'] = None
|
|
142
|
+
|
|
143
|
+
# set to None if connect_timeout (nullable) is None
|
|
144
|
+
# and model_fields_set contains the field
|
|
145
|
+
if self.connect_timeout is None and "connect_timeout" in self.model_fields_set:
|
|
146
|
+
_dict['connect_timeout'] = None
|
|
147
|
+
|
|
148
|
+
# set to None if sock_connect_timeout (nullable) is None
|
|
149
|
+
# and model_fields_set contains the field
|
|
150
|
+
if self.sock_connect_timeout is None and "sock_connect_timeout" in self.model_fields_set:
|
|
151
|
+
_dict['sock_connect_timeout'] = None
|
|
152
|
+
|
|
153
|
+
# set to None if sock_read_timeout (nullable) is None
|
|
154
|
+
# and model_fields_set contains the field
|
|
155
|
+
if self.sock_read_timeout is None and "sock_read_timeout" in self.model_fields_set:
|
|
156
|
+
_dict['sock_read_timeout'] = None
|
|
157
|
+
|
|
158
|
+
# set to None if rate_limit (nullable) is None
|
|
159
|
+
# and model_fields_set contains the field
|
|
160
|
+
if self.rate_limit is None and "rate_limit" in self.model_fields_set:
|
|
161
|
+
_dict['rate_limit'] = None
|
|
162
|
+
|
|
163
|
+
return _dict
|
|
164
|
+
|
|
165
|
+
@classmethod
|
|
166
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
167
|
+
"""Create an instance of FileFileRemoteResponse from a dict"""
|
|
168
|
+
if obj is None:
|
|
169
|
+
return None
|
|
170
|
+
|
|
171
|
+
if not isinstance(obj, dict):
|
|
172
|
+
return cls.model_validate(obj)
|
|
173
|
+
|
|
174
|
+
_obj = cls.model_validate({
|
|
175
|
+
"pulp_href": obj.get("pulp_href"),
|
|
176
|
+
"prn": obj.get("prn"),
|
|
177
|
+
"pulp_created": obj.get("pulp_created"),
|
|
178
|
+
"pulp_last_updated": obj.get("pulp_last_updated"),
|
|
179
|
+
"name": obj.get("name"),
|
|
180
|
+
"url": obj.get("url"),
|
|
181
|
+
"ca_cert": obj.get("ca_cert"),
|
|
182
|
+
"client_cert": obj.get("client_cert"),
|
|
183
|
+
"tls_validation": obj.get("tls_validation"),
|
|
184
|
+
"proxy_url": obj.get("proxy_url"),
|
|
185
|
+
"pulp_labels": obj.get("pulp_labels"),
|
|
186
|
+
"download_concurrency": obj.get("download_concurrency"),
|
|
187
|
+
"max_retries": obj.get("max_retries"),
|
|
188
|
+
"policy": obj.get("policy"),
|
|
189
|
+
"total_timeout": obj.get("total_timeout"),
|
|
190
|
+
"connect_timeout": obj.get("connect_timeout"),
|
|
191
|
+
"sock_connect_timeout": obj.get("sock_connect_timeout"),
|
|
192
|
+
"sock_read_timeout": obj.get("sock_read_timeout"),
|
|
193
|
+
"headers": obj.get("headers"),
|
|
194
|
+
"rate_limit": obj.get("rate_limit"),
|
|
195
|
+
"hidden_fields": [FileFileRemoteResponseHiddenFieldsInner.from_dict(_item) for _item in obj["hidden_fields"]] if obj.get("hidden_fields") is not None else None
|
|
196
|
+
})
|
|
197
|
+
return _obj
|
|
198
|
+
|
|
199
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
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, StrictBool, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class FileFileRemoteResponseHiddenFieldsInner(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
FileFileRemoteResponseHiddenFieldsInner
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: StrictStr
|
|
31
|
+
is_set: StrictBool
|
|
32
|
+
__properties: ClassVar[List[str]] = ["name", "is_set"]
|
|
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 FileFileRemoteResponseHiddenFieldsInner 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.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of FileFileRemoteResponseHiddenFieldsInner from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"name": obj.get("name"),
|
|
86
|
+
"is_set": obj.get("is_set")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|