internetdata 1.0.0__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.
- internetdata/__init__.py +49 -0
- internetdata/_core.py +287 -0
- internetdata/_generated/__init__.py +8 -0
- internetdata/_generated/api/__init__.py +1 -0
- internetdata/_generated/api/database_v_2/__init__.py +1 -0
- internetdata/_generated/api/database_v_2/database_checksum_v2.py +203 -0
- internetdata/_generated/api/database_v_2/database_metadata_v2.py +205 -0
- internetdata/_generated/api/database_v_2/download_database_v2.py +213 -0
- internetdata/_generated/api/database_v_2/list_databases.py +162 -0
- internetdata/_generated/api/database_v_2/list_downloads.py +178 -0
- internetdata/_generated/client.py +272 -0
- internetdata/_generated/errors.py +16 -0
- internetdata/_generated/models/__init__.py +53 -0
- internetdata/_generated/models/database.py +233 -0
- internetdata/_generated/models/database_checksum_v2_format.py +9 -0
- internetdata/_generated/models/database_checksum_v2_response_200.py +85 -0
- internetdata/_generated/models/database_checksum_v2_response_200_format.py +9 -0
- internetdata/_generated/models/database_metadata.py +132 -0
- internetdata/_generated/models/database_metadata_column.py +80 -0
- internetdata/_generated/models/database_metadata_sample.py +78 -0
- internetdata/_generated/models/database_metadata_sample_additional_property_item.py +45 -0
- internetdata/_generated/models/database_metadata_schema.py +72 -0
- internetdata/_generated/models/database_metadata_size.py +47 -0
- internetdata/_generated/models/database_redistribution_type_1.py +10 -0
- internetdata/_generated/models/database_redistribution_type_2_type_1.py +10 -0
- internetdata/_generated/models/database_redistribution_type_3_type_1.py +10 -0
- internetdata/_generated/models/database_standing.py +10 -0
- internetdata/_generated/models/database_version.py +97 -0
- internetdata/_generated/models/database_version_formats_item.py +9 -0
- internetdata/_generated/models/db_checksums.py +85 -0
- internetdata/_generated/models/download.py +161 -0
- internetdata/_generated/models/download_database_v2_format.py +9 -0
- internetdata/_generated/models/download_outcome.py +13 -0
- internetdata/_generated/models/error.py +62 -0
- internetdata/_generated/models/list_databases_response_200.py +75 -0
- internetdata/_generated/models/list_downloads_response_200.py +75 -0
- internetdata/_generated/types.py +54 -0
- internetdata/aio.py +268 -0
- internetdata/client.py +278 -0
- internetdata/errors.py +128 -0
- internetdata/models.py +197 -0
- internetdata/py.typed +0 -0
- internetdata-1.0.0.dist-info/METADATA +184 -0
- internetdata-1.0.0.dist-info/RECORD +46 -0
- internetdata-1.0.0.dist-info/WHEEL +4 -0
- internetdata-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.database_metadata_column import DatabaseMetadataColumn
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="DatabaseMetadataSchema")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class DatabaseMetadataSchema:
|
|
18
|
+
"""Columns, keyed by format."""
|
|
19
|
+
|
|
20
|
+
additional_properties: dict[str, list[DatabaseMetadataColumn]] = _attrs_field(
|
|
21
|
+
init=False, factory=dict
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
|
|
26
|
+
field_dict: dict[str, Any] = {}
|
|
27
|
+
for prop_name, prop in self.additional_properties.items():
|
|
28
|
+
field_dict[prop_name] = []
|
|
29
|
+
for additional_property_item_data in prop:
|
|
30
|
+
additional_property_item = additional_property_item_data.to_dict()
|
|
31
|
+
field_dict[prop_name].append(additional_property_item)
|
|
32
|
+
|
|
33
|
+
return field_dict
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
37
|
+
from ..models.database_metadata_column import DatabaseMetadataColumn
|
|
38
|
+
|
|
39
|
+
d = dict(src_dict)
|
|
40
|
+
database_metadata_schema = cls()
|
|
41
|
+
|
|
42
|
+
additional_properties = {}
|
|
43
|
+
for prop_name, prop_dict in d.items():
|
|
44
|
+
additional_property = []
|
|
45
|
+
_additional_property = prop_dict
|
|
46
|
+
for additional_property_item_data in _additional_property:
|
|
47
|
+
additional_property_item = DatabaseMetadataColumn.from_dict(
|
|
48
|
+
additional_property_item_data
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
additional_property.append(additional_property_item)
|
|
52
|
+
|
|
53
|
+
additional_properties[prop_name] = additional_property
|
|
54
|
+
|
|
55
|
+
database_metadata_schema.additional_properties = additional_properties
|
|
56
|
+
return database_metadata_schema
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def additional_keys(self) -> list[str]:
|
|
60
|
+
return list(self.additional_properties.keys())
|
|
61
|
+
|
|
62
|
+
def __getitem__(self, key: str) -> list[DatabaseMetadataColumn]:
|
|
63
|
+
return self.additional_properties[key]
|
|
64
|
+
|
|
65
|
+
def __setitem__(self, key: str, value: list[DatabaseMetadataColumn]) -> None:
|
|
66
|
+
self.additional_properties[key] = value
|
|
67
|
+
|
|
68
|
+
def __delitem__(self, key: str) -> None:
|
|
69
|
+
del self.additional_properties[key]
|
|
70
|
+
|
|
71
|
+
def __contains__(self, key: str) -> bool:
|
|
72
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="DatabaseMetadataSize")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class DatabaseMetadataSize:
|
|
14
|
+
"""Bytes per format."""
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict)
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> dict[str, Any]:
|
|
19
|
+
|
|
20
|
+
field_dict: dict[str, Any] = {}
|
|
21
|
+
field_dict.update(self.additional_properties)
|
|
22
|
+
|
|
23
|
+
return field_dict
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
27
|
+
d = dict(src_dict)
|
|
28
|
+
database_metadata_size = cls()
|
|
29
|
+
|
|
30
|
+
database_metadata_size.additional_properties = d
|
|
31
|
+
return database_metadata_size
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def additional_keys(self) -> list[str]:
|
|
35
|
+
return list(self.additional_properties.keys())
|
|
36
|
+
|
|
37
|
+
def __getitem__(self, key: str) -> int:
|
|
38
|
+
return self.additional_properties[key]
|
|
39
|
+
|
|
40
|
+
def __setitem__(self, key: str, value: int) -> None:
|
|
41
|
+
self.additional_properties[key] = value
|
|
42
|
+
|
|
43
|
+
def __delitem__(self, key: str) -> None:
|
|
44
|
+
del self.additional_properties[key]
|
|
45
|
+
|
|
46
|
+
def __contains__(self, key: str) -> bool:
|
|
47
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.database_version_formats_item import DatabaseVersionFormatsItem
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="DatabaseVersion")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class DatabaseVersion:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
id (str): The versioned id. Pass this to `download`, `checksum` and `metadata`. Example: vpn_ip_v1.
|
|
19
|
+
version (int): Example: 1.
|
|
20
|
+
summary (str):
|
|
21
|
+
formats (list[DatabaseVersionFormatsItem]): The formats this version is BUILT in. Asking for another is a 400,
|
|
22
|
+
not a gap - the `_provider` catalogs are keyed by provider id, so no
|
|
23
|
+
MMDB exists for them.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
id: str
|
|
27
|
+
version: int
|
|
28
|
+
summary: str
|
|
29
|
+
formats: list[DatabaseVersionFormatsItem]
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
|
33
|
+
id = self.id
|
|
34
|
+
|
|
35
|
+
version = self.version
|
|
36
|
+
|
|
37
|
+
summary = self.summary
|
|
38
|
+
|
|
39
|
+
formats = []
|
|
40
|
+
for formats_item_data in self.formats:
|
|
41
|
+
formats_item = formats_item_data.value
|
|
42
|
+
formats.append(formats_item)
|
|
43
|
+
|
|
44
|
+
field_dict: dict[str, Any] = {}
|
|
45
|
+
field_dict.update(self.additional_properties)
|
|
46
|
+
field_dict.update(
|
|
47
|
+
{
|
|
48
|
+
"id": id,
|
|
49
|
+
"version": version,
|
|
50
|
+
"summary": summary,
|
|
51
|
+
"formats": formats,
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
return field_dict
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
id = d.pop("id")
|
|
61
|
+
|
|
62
|
+
version = d.pop("version")
|
|
63
|
+
|
|
64
|
+
summary = d.pop("summary")
|
|
65
|
+
|
|
66
|
+
formats = []
|
|
67
|
+
_formats = d.pop("formats")
|
|
68
|
+
for formats_item_data in _formats:
|
|
69
|
+
formats_item = DatabaseVersionFormatsItem(formats_item_data)
|
|
70
|
+
|
|
71
|
+
formats.append(formats_item)
|
|
72
|
+
|
|
73
|
+
database_version = cls(
|
|
74
|
+
id=id,
|
|
75
|
+
version=version,
|
|
76
|
+
summary=summary,
|
|
77
|
+
formats=formats,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
database_version.additional_properties = d
|
|
81
|
+
return database_version
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def additional_keys(self) -> list[str]:
|
|
85
|
+
return list(self.additional_properties.keys())
|
|
86
|
+
|
|
87
|
+
def __getitem__(self, key: str) -> Any:
|
|
88
|
+
return self.additional_properties[key]
|
|
89
|
+
|
|
90
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
91
|
+
self.additional_properties[key] = value
|
|
92
|
+
|
|
93
|
+
def __delitem__(self, key: str) -> None:
|
|
94
|
+
del self.additional_properties[key]
|
|
95
|
+
|
|
96
|
+
def __contains__(self, key: str) -> bool:
|
|
97
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="DbChecksums")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class DbChecksums:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
md5 (str): Hex-encoded MD5 digest.
|
|
17
|
+
sha1 (str): Hex-encoded SHA-1 digest.
|
|
18
|
+
sha256 (str): Hex-encoded SHA-256 digest.
|
|
19
|
+
sha512 (str): Hex-encoded SHA-512 digest.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
md5: str
|
|
23
|
+
sha1: str
|
|
24
|
+
sha256: str
|
|
25
|
+
sha512: str
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
md5 = self.md5
|
|
30
|
+
|
|
31
|
+
sha1 = self.sha1
|
|
32
|
+
|
|
33
|
+
sha256 = self.sha256
|
|
34
|
+
|
|
35
|
+
sha512 = self.sha512
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update(
|
|
40
|
+
{
|
|
41
|
+
"md5": md5,
|
|
42
|
+
"sha1": sha1,
|
|
43
|
+
"sha256": sha256,
|
|
44
|
+
"sha512": sha512,
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
return field_dict
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
52
|
+
d = dict(src_dict)
|
|
53
|
+
md5 = d.pop("md5")
|
|
54
|
+
|
|
55
|
+
sha1 = d.pop("sha1")
|
|
56
|
+
|
|
57
|
+
sha256 = d.pop("sha256")
|
|
58
|
+
|
|
59
|
+
sha512 = d.pop("sha512")
|
|
60
|
+
|
|
61
|
+
db_checksums = cls(
|
|
62
|
+
md5=md5,
|
|
63
|
+
sha1=sha1,
|
|
64
|
+
sha256=sha256,
|
|
65
|
+
sha512=sha512,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
db_checksums.additional_properties = d
|
|
69
|
+
return db_checksums
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def additional_keys(self) -> list[str]:
|
|
73
|
+
return list(self.additional_properties.keys())
|
|
74
|
+
|
|
75
|
+
def __getitem__(self, key: str) -> Any:
|
|
76
|
+
return self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
79
|
+
self.additional_properties[key] = value
|
|
80
|
+
|
|
81
|
+
def __delitem__(self, key: str) -> None:
|
|
82
|
+
del self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __contains__(self, key: str) -> bool:
|
|
85
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import Any, Self, TypeVar, cast
|
|
6
|
+
|
|
7
|
+
from attrs import define as _attrs_define
|
|
8
|
+
from attrs import field as _attrs_field
|
|
9
|
+
|
|
10
|
+
from ..models.download_outcome import DownloadOutcome
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="Download")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class Download:
|
|
17
|
+
"""One download ATTEMPT, refusals included.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
dataset_id (str):
|
|
21
|
+
format_ (str):
|
|
22
|
+
outcome (DownloadOutcome):
|
|
23
|
+
bytes_ (int | None): Object size at redirect time, NOT bytes delivered: the transfer is a
|
|
24
|
+
presigned redirect straight to object storage, so we never observe
|
|
25
|
+
how much of it was taken.
|
|
26
|
+
http_status (int | None):
|
|
27
|
+
apikey_id (None | str): The key that made the request. Null when it could not be resolved.
|
|
28
|
+
client_ip (None | str):
|
|
29
|
+
user_agent (None | str):
|
|
30
|
+
created (datetime.datetime):
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
dataset_id: str
|
|
34
|
+
format_: str
|
|
35
|
+
outcome: DownloadOutcome
|
|
36
|
+
bytes_: int | None
|
|
37
|
+
http_status: int | None
|
|
38
|
+
apikey_id: None | str
|
|
39
|
+
client_ip: None | str
|
|
40
|
+
user_agent: None | str
|
|
41
|
+
created: datetime.datetime
|
|
42
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
dataset_id = self.dataset_id
|
|
46
|
+
|
|
47
|
+
format_ = self.format_
|
|
48
|
+
|
|
49
|
+
outcome = self.outcome.value
|
|
50
|
+
|
|
51
|
+
bytes_: int | None
|
|
52
|
+
bytes_ = self.bytes_
|
|
53
|
+
|
|
54
|
+
http_status: int | None
|
|
55
|
+
http_status = self.http_status
|
|
56
|
+
|
|
57
|
+
apikey_id: None | str
|
|
58
|
+
apikey_id = self.apikey_id
|
|
59
|
+
|
|
60
|
+
client_ip: None | str
|
|
61
|
+
client_ip = self.client_ip
|
|
62
|
+
|
|
63
|
+
user_agent: None | str
|
|
64
|
+
user_agent = self.user_agent
|
|
65
|
+
|
|
66
|
+
created = self.created.isoformat()
|
|
67
|
+
|
|
68
|
+
field_dict: dict[str, Any] = {}
|
|
69
|
+
field_dict.update(self.additional_properties)
|
|
70
|
+
field_dict.update(
|
|
71
|
+
{
|
|
72
|
+
"dataset_id": dataset_id,
|
|
73
|
+
"format": format_,
|
|
74
|
+
"outcome": outcome,
|
|
75
|
+
"bytes": bytes_,
|
|
76
|
+
"http_status": http_status,
|
|
77
|
+
"apikey_id": apikey_id,
|
|
78
|
+
"client_ip": client_ip,
|
|
79
|
+
"user_agent": user_agent,
|
|
80
|
+
"created": created,
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return field_dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
88
|
+
d = dict(src_dict)
|
|
89
|
+
dataset_id = d.pop("dataset_id")
|
|
90
|
+
|
|
91
|
+
format_ = d.pop("format")
|
|
92
|
+
|
|
93
|
+
outcome = DownloadOutcome(d.pop("outcome"))
|
|
94
|
+
|
|
95
|
+
def _parse_bytes_(data: object) -> int | None:
|
|
96
|
+
if data is None:
|
|
97
|
+
return data
|
|
98
|
+
return cast(int | None, data)
|
|
99
|
+
|
|
100
|
+
bytes_ = _parse_bytes_(d.pop("bytes"))
|
|
101
|
+
|
|
102
|
+
def _parse_http_status(data: object) -> int | None:
|
|
103
|
+
if data is None:
|
|
104
|
+
return data
|
|
105
|
+
return cast(int | None, data)
|
|
106
|
+
|
|
107
|
+
http_status = _parse_http_status(d.pop("http_status"))
|
|
108
|
+
|
|
109
|
+
def _parse_apikey_id(data: object) -> None | str:
|
|
110
|
+
if data is None:
|
|
111
|
+
return data
|
|
112
|
+
return cast(None | str, data)
|
|
113
|
+
|
|
114
|
+
apikey_id = _parse_apikey_id(d.pop("apikey_id"))
|
|
115
|
+
|
|
116
|
+
def _parse_client_ip(data: object) -> None | str:
|
|
117
|
+
if data is None:
|
|
118
|
+
return data
|
|
119
|
+
return cast(None | str, data)
|
|
120
|
+
|
|
121
|
+
client_ip = _parse_client_ip(d.pop("client_ip"))
|
|
122
|
+
|
|
123
|
+
def _parse_user_agent(data: object) -> None | str:
|
|
124
|
+
if data is None:
|
|
125
|
+
return data
|
|
126
|
+
return cast(None | str, data)
|
|
127
|
+
|
|
128
|
+
user_agent = _parse_user_agent(d.pop("user_agent"))
|
|
129
|
+
|
|
130
|
+
created = datetime.datetime.fromisoformat(d.pop("created"))
|
|
131
|
+
|
|
132
|
+
download = cls(
|
|
133
|
+
dataset_id=dataset_id,
|
|
134
|
+
format_=format_,
|
|
135
|
+
outcome=outcome,
|
|
136
|
+
bytes_=bytes_,
|
|
137
|
+
http_status=http_status,
|
|
138
|
+
apikey_id=apikey_id,
|
|
139
|
+
client_ip=client_ip,
|
|
140
|
+
user_agent=user_agent,
|
|
141
|
+
created=created,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
download.additional_properties = d
|
|
145
|
+
return download
|
|
146
|
+
|
|
147
|
+
@property
|
|
148
|
+
def additional_keys(self) -> list[str]:
|
|
149
|
+
return list(self.additional_properties.keys())
|
|
150
|
+
|
|
151
|
+
def __getitem__(self, key: str) -> Any:
|
|
152
|
+
return self.additional_properties[key]
|
|
153
|
+
|
|
154
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
155
|
+
self.additional_properties[key] = value
|
|
156
|
+
|
|
157
|
+
def __delitem__(self, key: str) -> None:
|
|
158
|
+
del self.additional_properties[key]
|
|
159
|
+
|
|
160
|
+
def __contains__(self, key: str) -> bool:
|
|
161
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DownloadOutcome(StrEnum):
|
|
5
|
+
DENIED = "denied"
|
|
6
|
+
EXPIRED = "expired"
|
|
7
|
+
OK = "ok"
|
|
8
|
+
UNAUTHORIZED = "unauthorized"
|
|
9
|
+
UNAVAILABLE = "unavailable"
|
|
10
|
+
UNKNOWN = "unknown"
|
|
11
|
+
|
|
12
|
+
def __str__(self) -> str:
|
|
13
|
+
return str(self.value)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="Error")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class Error:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
rc (str): A machine-readable result code. Deliberately not an enum: a code
|
|
17
|
+
added later must stay parseable by a client generated today.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
rc: str
|
|
21
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
22
|
+
|
|
23
|
+
def to_dict(self) -> dict[str, Any]:
|
|
24
|
+
rc = self.rc
|
|
25
|
+
|
|
26
|
+
field_dict: dict[str, Any] = {}
|
|
27
|
+
field_dict.update(self.additional_properties)
|
|
28
|
+
field_dict.update(
|
|
29
|
+
{
|
|
30
|
+
"rc": rc,
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
return field_dict
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
38
|
+
d = dict(src_dict)
|
|
39
|
+
rc = d.pop("rc")
|
|
40
|
+
|
|
41
|
+
error = cls(
|
|
42
|
+
rc=rc,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
error.additional_properties = d
|
|
46
|
+
return error
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def additional_keys(self) -> list[str]:
|
|
50
|
+
return list(self.additional_properties.keys())
|
|
51
|
+
|
|
52
|
+
def __getitem__(self, key: str) -> Any:
|
|
53
|
+
return self.additional_properties[key]
|
|
54
|
+
|
|
55
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
56
|
+
self.additional_properties[key] = value
|
|
57
|
+
|
|
58
|
+
def __delitem__(self, key: str) -> None:
|
|
59
|
+
del self.additional_properties[key]
|
|
60
|
+
|
|
61
|
+
def __contains__(self, key: str) -> bool:
|
|
62
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.database import Database
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="ListDatabasesResponse200")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class ListDatabasesResponse200:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
databases (list[Database]):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
databases: list[Database]
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
databases = []
|
|
28
|
+
for databases_item_data in self.databases:
|
|
29
|
+
databases_item = databases_item_data.to_dict()
|
|
30
|
+
databases.append(databases_item)
|
|
31
|
+
|
|
32
|
+
field_dict: dict[str, Any] = {}
|
|
33
|
+
field_dict.update(self.additional_properties)
|
|
34
|
+
field_dict.update(
|
|
35
|
+
{
|
|
36
|
+
"databases": databases,
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return field_dict
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
44
|
+
from ..models.database import Database
|
|
45
|
+
|
|
46
|
+
d = dict(src_dict)
|
|
47
|
+
databases = []
|
|
48
|
+
_databases = d.pop("databases")
|
|
49
|
+
for databases_item_data in _databases:
|
|
50
|
+
databases_item = Database.from_dict(databases_item_data)
|
|
51
|
+
|
|
52
|
+
databases.append(databases_item)
|
|
53
|
+
|
|
54
|
+
list_databases_response_200 = cls(
|
|
55
|
+
databases=databases,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
list_databases_response_200.additional_properties = d
|
|
59
|
+
return list_databases_response_200
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def additional_keys(self) -> list[str]:
|
|
63
|
+
return list(self.additional_properties.keys())
|
|
64
|
+
|
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
|
66
|
+
return self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
69
|
+
self.additional_properties[key] = value
|
|
70
|
+
|
|
71
|
+
def __delitem__(self, key: str) -> None:
|
|
72
|
+
del self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __contains__(self, key: str) -> bool:
|
|
75
|
+
return key in self.additional_properties
|