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,233 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import TYPE_CHECKING, 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.database_redistribution_type_1 import DatabaseRedistributionType1
|
|
11
|
+
from ..models.database_redistribution_type_2_type_1 import DatabaseRedistributionType2Type1
|
|
12
|
+
from ..models.database_redistribution_type_3_type_1 import DatabaseRedistributionType3Type1
|
|
13
|
+
from ..models.database_standing import DatabaseStanding
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..models.database_version import DatabaseVersion
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="Database")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class Database:
|
|
24
|
+
"""One database FAMILY, with your organization's licence beside it. A
|
|
25
|
+
licence covers the family, while a download names a specific version,
|
|
26
|
+
so the ids passed to `download` and `checksum` come from `versions`.
|
|
27
|
+
|
|
28
|
+
Attributes:
|
|
29
|
+
base (str): The family, e.g. `vpn_ip`. What a licence is held against. Example: vpn_ip.
|
|
30
|
+
name (str): Example: VPN IP.
|
|
31
|
+
summary (str): One line on what the newest version contains.
|
|
32
|
+
standing (DatabaseStanding): `licensed` is a live grant, `expired` one whose term has ended, and
|
|
33
|
+
`unlicensed` a database published but never bought.
|
|
34
|
+
redistribution (DatabaseRedistributionType1 | DatabaseRedistributionType2Type1 |
|
|
35
|
+
DatabaseRedistributionType3Type1 | None): What your licence permits you to do with the data. Null when there
|
|
36
|
+
is no licence.
|
|
37
|
+
starts (datetime.datetime | None):
|
|
38
|
+
expires (datetime.datetime | None): Null when the licence has no end date, or when there is none.
|
|
39
|
+
versions (list[DatabaseVersion]): Every published version of this family, oldest first. Old versions
|
|
40
|
+
are frozen rather than migrated, so both stay downloadable.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
base: str
|
|
44
|
+
name: str
|
|
45
|
+
summary: str
|
|
46
|
+
standing: DatabaseStanding
|
|
47
|
+
redistribution: (
|
|
48
|
+
DatabaseRedistributionType1
|
|
49
|
+
| DatabaseRedistributionType2Type1
|
|
50
|
+
| DatabaseRedistributionType3Type1
|
|
51
|
+
| None
|
|
52
|
+
)
|
|
53
|
+
starts: datetime.datetime | None
|
|
54
|
+
expires: datetime.datetime | None
|
|
55
|
+
versions: list[DatabaseVersion]
|
|
56
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> dict[str, Any]:
|
|
59
|
+
base = self.base
|
|
60
|
+
|
|
61
|
+
name = self.name
|
|
62
|
+
|
|
63
|
+
summary = self.summary
|
|
64
|
+
|
|
65
|
+
standing = self.standing.value
|
|
66
|
+
|
|
67
|
+
redistribution: None | str
|
|
68
|
+
if (
|
|
69
|
+
isinstance(self.redistribution, DatabaseRedistributionType1)
|
|
70
|
+
or isinstance(self.redistribution, DatabaseRedistributionType2Type1)
|
|
71
|
+
or isinstance(self.redistribution, DatabaseRedistributionType3Type1)
|
|
72
|
+
):
|
|
73
|
+
redistribution = self.redistribution.value
|
|
74
|
+
else:
|
|
75
|
+
redistribution = self.redistribution
|
|
76
|
+
|
|
77
|
+
starts: None | str
|
|
78
|
+
if isinstance(self.starts, datetime.datetime):
|
|
79
|
+
starts = self.starts.isoformat()
|
|
80
|
+
else:
|
|
81
|
+
starts = self.starts
|
|
82
|
+
|
|
83
|
+
expires: None | str
|
|
84
|
+
if isinstance(self.expires, datetime.datetime):
|
|
85
|
+
expires = self.expires.isoformat()
|
|
86
|
+
else:
|
|
87
|
+
expires = self.expires
|
|
88
|
+
|
|
89
|
+
versions = []
|
|
90
|
+
for versions_item_data in self.versions:
|
|
91
|
+
versions_item = versions_item_data.to_dict()
|
|
92
|
+
versions.append(versions_item)
|
|
93
|
+
|
|
94
|
+
field_dict: dict[str, Any] = {}
|
|
95
|
+
field_dict.update(self.additional_properties)
|
|
96
|
+
field_dict.update(
|
|
97
|
+
{
|
|
98
|
+
"base": base,
|
|
99
|
+
"name": name,
|
|
100
|
+
"summary": summary,
|
|
101
|
+
"standing": standing,
|
|
102
|
+
"redistribution": redistribution,
|
|
103
|
+
"starts": starts,
|
|
104
|
+
"expires": expires,
|
|
105
|
+
"versions": versions,
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return field_dict
|
|
110
|
+
|
|
111
|
+
@classmethod
|
|
112
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
113
|
+
from ..models.database_version import DatabaseVersion
|
|
114
|
+
|
|
115
|
+
d = dict(src_dict)
|
|
116
|
+
base = d.pop("base")
|
|
117
|
+
|
|
118
|
+
name = d.pop("name")
|
|
119
|
+
|
|
120
|
+
summary = d.pop("summary")
|
|
121
|
+
|
|
122
|
+
standing = DatabaseStanding(d.pop("standing"))
|
|
123
|
+
|
|
124
|
+
def _parse_redistribution(
|
|
125
|
+
data: object,
|
|
126
|
+
) -> (
|
|
127
|
+
DatabaseRedistributionType1
|
|
128
|
+
| DatabaseRedistributionType2Type1
|
|
129
|
+
| DatabaseRedistributionType3Type1
|
|
130
|
+
| None
|
|
131
|
+
):
|
|
132
|
+
if data is None:
|
|
133
|
+
return data
|
|
134
|
+
try:
|
|
135
|
+
if not isinstance(data, str):
|
|
136
|
+
raise TypeError()
|
|
137
|
+
redistribution_type_1 = DatabaseRedistributionType1(data)
|
|
138
|
+
|
|
139
|
+
return redistribution_type_1
|
|
140
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
141
|
+
pass
|
|
142
|
+
try:
|
|
143
|
+
if not isinstance(data, str):
|
|
144
|
+
raise TypeError()
|
|
145
|
+
redistribution_type_2_type_1 = DatabaseRedistributionType2Type1(data)
|
|
146
|
+
|
|
147
|
+
return redistribution_type_2_type_1
|
|
148
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
149
|
+
pass
|
|
150
|
+
try:
|
|
151
|
+
if not isinstance(data, str):
|
|
152
|
+
raise TypeError()
|
|
153
|
+
redistribution_type_3_type_1 = DatabaseRedistributionType3Type1(data)
|
|
154
|
+
|
|
155
|
+
return redistribution_type_3_type_1
|
|
156
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
157
|
+
pass
|
|
158
|
+
return cast(
|
|
159
|
+
DatabaseRedistributionType1
|
|
160
|
+
| DatabaseRedistributionType2Type1
|
|
161
|
+
| DatabaseRedistributionType3Type1
|
|
162
|
+
| None,
|
|
163
|
+
data,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
redistribution = _parse_redistribution(d.pop("redistribution"))
|
|
167
|
+
|
|
168
|
+
def _parse_starts(data: object) -> datetime.datetime | None:
|
|
169
|
+
if data is None:
|
|
170
|
+
return data
|
|
171
|
+
try:
|
|
172
|
+
if not isinstance(data, str):
|
|
173
|
+
raise TypeError()
|
|
174
|
+
starts_type_0 = datetime.datetime.fromisoformat(data)
|
|
175
|
+
|
|
176
|
+
return starts_type_0
|
|
177
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
178
|
+
pass
|
|
179
|
+
return cast(datetime.datetime | None, data)
|
|
180
|
+
|
|
181
|
+
starts = _parse_starts(d.pop("starts"))
|
|
182
|
+
|
|
183
|
+
def _parse_expires(data: object) -> datetime.datetime | None:
|
|
184
|
+
if data is None:
|
|
185
|
+
return data
|
|
186
|
+
try:
|
|
187
|
+
if not isinstance(data, str):
|
|
188
|
+
raise TypeError()
|
|
189
|
+
expires_type_0 = datetime.datetime.fromisoformat(data)
|
|
190
|
+
|
|
191
|
+
return expires_type_0
|
|
192
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
193
|
+
pass
|
|
194
|
+
return cast(datetime.datetime | None, data)
|
|
195
|
+
|
|
196
|
+
expires = _parse_expires(d.pop("expires"))
|
|
197
|
+
|
|
198
|
+
versions = []
|
|
199
|
+
_versions = d.pop("versions")
|
|
200
|
+
for versions_item_data in _versions:
|
|
201
|
+
versions_item = DatabaseVersion.from_dict(versions_item_data)
|
|
202
|
+
|
|
203
|
+
versions.append(versions_item)
|
|
204
|
+
|
|
205
|
+
database = cls(
|
|
206
|
+
base=base,
|
|
207
|
+
name=name,
|
|
208
|
+
summary=summary,
|
|
209
|
+
standing=standing,
|
|
210
|
+
redistribution=redistribution,
|
|
211
|
+
starts=starts,
|
|
212
|
+
expires=expires,
|
|
213
|
+
versions=versions,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
database.additional_properties = d
|
|
217
|
+
return database
|
|
218
|
+
|
|
219
|
+
@property
|
|
220
|
+
def additional_keys(self) -> list[str]:
|
|
221
|
+
return list(self.additional_properties.keys())
|
|
222
|
+
|
|
223
|
+
def __getitem__(self, key: str) -> Any:
|
|
224
|
+
return self.additional_properties[key]
|
|
225
|
+
|
|
226
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
227
|
+
self.additional_properties[key] = value
|
|
228
|
+
|
|
229
|
+
def __delitem__(self, key: str) -> None:
|
|
230
|
+
del self.additional_properties[key]
|
|
231
|
+
|
|
232
|
+
def __contains__(self, key: str) -> bool:
|
|
233
|
+
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 TYPE_CHECKING, 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_checksum_v2_response_200_format import DatabaseChecksumV2Response200Format
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.db_checksums import DbChecksums
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="DatabaseChecksumV2Response200")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class DatabaseChecksumV2Response200:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
id (str):
|
|
23
|
+
format_ (DatabaseChecksumV2Response200Format):
|
|
24
|
+
checksums (DbChecksums):
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
id: str
|
|
28
|
+
format_: DatabaseChecksumV2Response200Format
|
|
29
|
+
checksums: DbChecksums
|
|
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
|
+
format_ = self.format_.value
|
|
36
|
+
|
|
37
|
+
checksums = self.checksums.to_dict()
|
|
38
|
+
|
|
39
|
+
field_dict: dict[str, Any] = {}
|
|
40
|
+
field_dict.update(self.additional_properties)
|
|
41
|
+
field_dict.update(
|
|
42
|
+
{
|
|
43
|
+
"id": id,
|
|
44
|
+
"format": format_,
|
|
45
|
+
"checksums": checksums,
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
return field_dict
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
53
|
+
from ..models.db_checksums import DbChecksums
|
|
54
|
+
|
|
55
|
+
d = dict(src_dict)
|
|
56
|
+
id = d.pop("id")
|
|
57
|
+
|
|
58
|
+
format_ = DatabaseChecksumV2Response200Format(d.pop("format"))
|
|
59
|
+
|
|
60
|
+
checksums = DbChecksums.from_dict(d.pop("checksums"))
|
|
61
|
+
|
|
62
|
+
database_checksum_v2_response_200 = cls(
|
|
63
|
+
id=id,
|
|
64
|
+
format_=format_,
|
|
65
|
+
checksums=checksums,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
database_checksum_v2_response_200.additional_properties = d
|
|
69
|
+
return database_checksum_v2_response_200
|
|
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,132 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Self, TypeVar
|
|
6
|
+
|
|
7
|
+
from attrs import define as _attrs_define
|
|
8
|
+
from attrs import field as _attrs_field
|
|
9
|
+
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from ..models.database_metadata_sample import DatabaseMetadataSample
|
|
14
|
+
from ..models.database_metadata_schema import DatabaseMetadataSchema
|
|
15
|
+
from ..models.database_metadata_size import DatabaseMetadataSize
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="DatabaseMetadata")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class DatabaseMetadata:
|
|
23
|
+
"""The build document written by the exporter, served through unchanged.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
id (str):
|
|
27
|
+
updated (datetime.date): ISO-8601 date (YYYY-MM-DD) the published build was generated on. Example: 2026-09-04.
|
|
28
|
+
entries (int): Row count in the current build.
|
|
29
|
+
schema (DatabaseMetadataSchema): Columns, keyed by format.
|
|
30
|
+
size (DatabaseMetadataSize): Bytes per format.
|
|
31
|
+
update_freq (str | Unset): How often a new build is published.
|
|
32
|
+
sample (DatabaseMetadataSample | Unset): A few real rows, keyed by format.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
id: str
|
|
36
|
+
updated: datetime.date
|
|
37
|
+
entries: int
|
|
38
|
+
schema: DatabaseMetadataSchema
|
|
39
|
+
size: DatabaseMetadataSize
|
|
40
|
+
update_freq: str | Unset = UNSET
|
|
41
|
+
sample: DatabaseMetadataSample | Unset = UNSET
|
|
42
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
id = self.id
|
|
46
|
+
|
|
47
|
+
updated = self.updated.isoformat()
|
|
48
|
+
|
|
49
|
+
entries = self.entries
|
|
50
|
+
|
|
51
|
+
schema = self.schema.to_dict()
|
|
52
|
+
|
|
53
|
+
size = self.size.to_dict()
|
|
54
|
+
|
|
55
|
+
update_freq = self.update_freq
|
|
56
|
+
|
|
57
|
+
sample: dict[str, Any] | Unset = UNSET
|
|
58
|
+
if not isinstance(self.sample, Unset):
|
|
59
|
+
sample = self.sample.to_dict()
|
|
60
|
+
|
|
61
|
+
field_dict: dict[str, Any] = {}
|
|
62
|
+
field_dict.update(self.additional_properties)
|
|
63
|
+
field_dict.update(
|
|
64
|
+
{
|
|
65
|
+
"id": id,
|
|
66
|
+
"updated": updated,
|
|
67
|
+
"entries": entries,
|
|
68
|
+
"schema": schema,
|
|
69
|
+
"size": size,
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
if update_freq is not UNSET:
|
|
73
|
+
field_dict["update_freq"] = update_freq
|
|
74
|
+
if sample is not UNSET:
|
|
75
|
+
field_dict["sample"] = sample
|
|
76
|
+
|
|
77
|
+
return field_dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
81
|
+
from ..models.database_metadata_sample import DatabaseMetadataSample
|
|
82
|
+
from ..models.database_metadata_schema import DatabaseMetadataSchema
|
|
83
|
+
from ..models.database_metadata_size import DatabaseMetadataSize
|
|
84
|
+
|
|
85
|
+
d = dict(src_dict)
|
|
86
|
+
id = d.pop("id")
|
|
87
|
+
|
|
88
|
+
updated = datetime.date.fromisoformat(d.pop("updated"))
|
|
89
|
+
|
|
90
|
+
entries = d.pop("entries")
|
|
91
|
+
|
|
92
|
+
schema = DatabaseMetadataSchema.from_dict(d.pop("schema"))
|
|
93
|
+
|
|
94
|
+
size = DatabaseMetadataSize.from_dict(d.pop("size"))
|
|
95
|
+
|
|
96
|
+
update_freq = d.pop("update_freq", UNSET)
|
|
97
|
+
|
|
98
|
+
_sample = d.pop("sample", UNSET)
|
|
99
|
+
sample: DatabaseMetadataSample | Unset
|
|
100
|
+
if isinstance(_sample, Unset):
|
|
101
|
+
sample = UNSET
|
|
102
|
+
else:
|
|
103
|
+
sample = DatabaseMetadataSample.from_dict(_sample)
|
|
104
|
+
|
|
105
|
+
database_metadata = cls(
|
|
106
|
+
id=id,
|
|
107
|
+
updated=updated,
|
|
108
|
+
entries=entries,
|
|
109
|
+
schema=schema,
|
|
110
|
+
size=size,
|
|
111
|
+
update_freq=update_freq,
|
|
112
|
+
sample=sample,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
database_metadata.additional_properties = d
|
|
116
|
+
return database_metadata
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def additional_keys(self) -> list[str]:
|
|
120
|
+
return list(self.additional_properties.keys())
|
|
121
|
+
|
|
122
|
+
def __getitem__(self, key: str) -> Any:
|
|
123
|
+
return self.additional_properties[key]
|
|
124
|
+
|
|
125
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
126
|
+
self.additional_properties[key] = value
|
|
127
|
+
|
|
128
|
+
def __delitem__(self, key: str) -> None:
|
|
129
|
+
del self.additional_properties[key]
|
|
130
|
+
|
|
131
|
+
def __contains__(self, key: str) -> bool:
|
|
132
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,80 @@
|
|
|
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 ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="DatabaseMetadataColumn")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class DatabaseMetadataColumn:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
name (str):
|
|
19
|
+
type_ (str):
|
|
20
|
+
description (str | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
name: str
|
|
24
|
+
type_: str
|
|
25
|
+
description: str | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
name = self.name
|
|
30
|
+
|
|
31
|
+
type_ = self.type_
|
|
32
|
+
|
|
33
|
+
description = self.description
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"name": name,
|
|
40
|
+
"type": type_,
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
if description is not UNSET:
|
|
44
|
+
field_dict["description"] = description
|
|
45
|
+
|
|
46
|
+
return field_dict
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
50
|
+
d = dict(src_dict)
|
|
51
|
+
name = d.pop("name")
|
|
52
|
+
|
|
53
|
+
type_ = d.pop("type")
|
|
54
|
+
|
|
55
|
+
description = d.pop("description", UNSET)
|
|
56
|
+
|
|
57
|
+
database_metadata_column = cls(
|
|
58
|
+
name=name,
|
|
59
|
+
type_=type_,
|
|
60
|
+
description=description,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
database_metadata_column.additional_properties = d
|
|
64
|
+
return database_metadata_column
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def additional_keys(self) -> list[str]:
|
|
68
|
+
return list(self.additional_properties.keys())
|
|
69
|
+
|
|
70
|
+
def __getitem__(self, key: str) -> Any:
|
|
71
|
+
return self.additional_properties[key]
|
|
72
|
+
|
|
73
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
74
|
+
self.additional_properties[key] = value
|
|
75
|
+
|
|
76
|
+
def __delitem__(self, key: str) -> None:
|
|
77
|
+
del self.additional_properties[key]
|
|
78
|
+
|
|
79
|
+
def __contains__(self, key: str) -> bool:
|
|
80
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,78 @@
|
|
|
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_sample_additional_property_item import (
|
|
11
|
+
DatabaseMetadataSampleAdditionalPropertyItem,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="DatabaseMetadataSample")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class DatabaseMetadataSample:
|
|
20
|
+
"""A few real rows, keyed by format."""
|
|
21
|
+
|
|
22
|
+
additional_properties: dict[str, list[DatabaseMetadataSampleAdditionalPropertyItem]] = (
|
|
23
|
+
_attrs_field(init=False, factory=dict)
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
|
|
28
|
+
field_dict: dict[str, Any] = {}
|
|
29
|
+
for prop_name, prop in self.additional_properties.items():
|
|
30
|
+
field_dict[prop_name] = []
|
|
31
|
+
for additional_property_item_data in prop:
|
|
32
|
+
additional_property_item = additional_property_item_data.to_dict()
|
|
33
|
+
field_dict[prop_name].append(additional_property_item)
|
|
34
|
+
|
|
35
|
+
return field_dict
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
39
|
+
from ..models.database_metadata_sample_additional_property_item import (
|
|
40
|
+
DatabaseMetadataSampleAdditionalPropertyItem,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
d = dict(src_dict)
|
|
44
|
+
database_metadata_sample = cls()
|
|
45
|
+
|
|
46
|
+
additional_properties = {}
|
|
47
|
+
for prop_name, prop_dict in d.items():
|
|
48
|
+
additional_property = []
|
|
49
|
+
_additional_property = prop_dict
|
|
50
|
+
for additional_property_item_data in _additional_property:
|
|
51
|
+
additional_property_item = DatabaseMetadataSampleAdditionalPropertyItem.from_dict(
|
|
52
|
+
additional_property_item_data
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
additional_property.append(additional_property_item)
|
|
56
|
+
|
|
57
|
+
additional_properties[prop_name] = additional_property
|
|
58
|
+
|
|
59
|
+
database_metadata_sample.additional_properties = additional_properties
|
|
60
|
+
return database_metadata_sample
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def additional_keys(self) -> list[str]:
|
|
64
|
+
return list(self.additional_properties.keys())
|
|
65
|
+
|
|
66
|
+
def __getitem__(self, key: str) -> list[DatabaseMetadataSampleAdditionalPropertyItem]:
|
|
67
|
+
return self.additional_properties[key]
|
|
68
|
+
|
|
69
|
+
def __setitem__(
|
|
70
|
+
self, key: str, value: list[DatabaseMetadataSampleAdditionalPropertyItem]
|
|
71
|
+
) -> None:
|
|
72
|
+
self.additional_properties[key] = value
|
|
73
|
+
|
|
74
|
+
def __delitem__(self, key: str) -> None:
|
|
75
|
+
del self.additional_properties[key]
|
|
76
|
+
|
|
77
|
+
def __contains__(self, key: str) -> bool:
|
|
78
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,45 @@
|
|
|
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="DatabaseMetadataSampleAdditionalPropertyItem")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class DatabaseMetadataSampleAdditionalPropertyItem:
|
|
14
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
15
|
+
|
|
16
|
+
def to_dict(self) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
field_dict: dict[str, Any] = {}
|
|
19
|
+
field_dict.update(self.additional_properties)
|
|
20
|
+
|
|
21
|
+
return field_dict
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
25
|
+
d = dict(src_dict)
|
|
26
|
+
database_metadata_sample_additional_property_item = cls()
|
|
27
|
+
|
|
28
|
+
database_metadata_sample_additional_property_item.additional_properties = d
|
|
29
|
+
return database_metadata_sample_additional_property_item
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def additional_keys(self) -> list[str]:
|
|
33
|
+
return list(self.additional_properties.keys())
|
|
34
|
+
|
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
|
36
|
+
return self.additional_properties[key]
|
|
37
|
+
|
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
39
|
+
self.additional_properties[key] = value
|
|
40
|
+
|
|
41
|
+
def __delitem__(self, key: str) -> None:
|
|
42
|
+
del self.additional_properties[key]
|
|
43
|
+
|
|
44
|
+
def __contains__(self, key: str) -> bool:
|
|
45
|
+
return key in self.additional_properties
|