apex-dispatch-api-client 0.7.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.
- apex_dispatch_api_client/__about__.py +15 -0
- apex_dispatch_api_client/__init__.py +8 -0
- apex_dispatch_api_client/api/__init__.py +1 -0
- apex_dispatch_api_client/api/default/__init__.py +1 -0
- apex_dispatch_api_client/api/default/health_health_get.py +85 -0
- apex_dispatch_api_client/api/unit_jobs/__init__.py +1 -0
- apex_dispatch_api_client/api/unit_jobs/create_sync_job_sync_jobs_post.py +178 -0
- apex_dispatch_api_client/api/unit_jobs/create_unit_job_unit_jobs_post.py +180 -0
- apex_dispatch_api_client/api/unit_jobs/delete_job_unit_jobs_job_id_delete.py +170 -0
- apex_dispatch_api_client/api/unit_jobs/get_job_params_params_post.py +179 -0
- apex_dispatch_api_client/api/unit_jobs/get_job_results_unit_jobs_job_id_results_get.py +186 -0
- apex_dispatch_api_client/api/unit_jobs/get_job_unit_jobs_job_id_get.py +172 -0
- apex_dispatch_api_client/api/upscale_tasks/__init__.py +1 -0
- apex_dispatch_api_client/api/upscale_tasks/create_upscale_task_upscale_tasks_post.py +180 -0
- apex_dispatch_api_client/api/upscale_tasks/get_jobs_status_jobs_status_get.py +192 -0
- apex_dispatch_api_client/api/upscale_tasks/get_upscale_task_upscale_tasks_task_id_get.py +172 -0
- apex_dispatch_api_client/api/upscale_tasks/split_in_tiles_tiles_post.py +184 -0
- apex_dispatch_api_client/client.py +282 -0
- apex_dispatch_api_client/errors.py +16 -0
- apex_dispatch_api_client/models/__init__.py +99 -0
- apex_dispatch_api_client/models/asset.py +155 -0
- apex_dispatch_api_client/models/base_job_request.py +104 -0
- apex_dispatch_api_client/models/base_job_request_parameters.py +47 -0
- apex_dispatch_api_client/models/collection.py +332 -0
- apex_dispatch_api_client/models/collection_assets_type_0.py +60 -0
- apex_dispatch_api_client/models/collection_summaries_type_0.py +109 -0
- apex_dispatch_api_client/models/collection_summaries_type_0_additional_property_type_2.py +47 -0
- apex_dispatch_api_client/models/error_response.py +138 -0
- apex_dispatch_api_client/models/error_response_details_type_0.py +47 -0
- apex_dispatch_api_client/models/extent.py +80 -0
- apex_dispatch_api_client/models/geometry_collection.py +247 -0
- apex_dispatch_api_client/models/grid_type_enum.py +9 -0
- apex_dispatch_api_client/models/http_validation_error.py +79 -0
- apex_dispatch_api_client/models/jobs_filter.py +9 -0
- apex_dispatch_api_client/models/jobs_status_response.py +97 -0
- apex_dispatch_api_client/models/line_string.py +163 -0
- apex_dispatch_api_client/models/link.py +123 -0
- apex_dispatch_api_client/models/mime_types.py +37 -0
- apex_dispatch_api_client/models/multi_line_string.py +180 -0
- apex_dispatch_api_client/models/multi_point.py +163 -0
- apex_dispatch_api_client/models/multi_polygon.py +191 -0
- apex_dispatch_api_client/models/output_format_enum.py +11 -0
- apex_dispatch_api_client/models/param_request.py +77 -0
- apex_dispatch_api_client/models/param_type_enum.py +16 -0
- apex_dispatch_api_client/models/parameter.py +108 -0
- apex_dispatch_api_client/models/parameter_dimension.py +69 -0
- apex_dispatch_api_client/models/point.py +151 -0
- apex_dispatch_api_client/models/polygon.py +180 -0
- apex_dispatch_api_client/models/process_type_enum.py +9 -0
- apex_dispatch_api_client/models/processing_job.py +130 -0
- apex_dispatch_api_client/models/processing_job_parameters.py +47 -0
- apex_dispatch_api_client/models/processing_job_summary.py +116 -0
- apex_dispatch_api_client/models/processing_job_summary_parameters.py +47 -0
- apex_dispatch_api_client/models/processing_status_enum.py +14 -0
- apex_dispatch_api_client/models/provider.py +135 -0
- apex_dispatch_api_client/models/range_.py +79 -0
- apex_dispatch_api_client/models/service_details.py +95 -0
- apex_dispatch_api_client/models/spatial_extent.py +96 -0
- apex_dispatch_api_client/models/tile_request.py +77 -0
- apex_dispatch_api_client/models/time_interval.py +99 -0
- apex_dispatch_api_client/models/upscaling_task.py +138 -0
- apex_dispatch_api_client/models/upscaling_task_request.py +118 -0
- apex_dispatch_api_client/models/upscaling_task_request_parameters.py +47 -0
- apex_dispatch_api_client/models/upscaling_task_summary.py +88 -0
- apex_dispatch_api_client/models/validation_error.py +123 -0
- apex_dispatch_api_client/models/validation_error_context.py +47 -0
- apex_dispatch_api_client/types.py +54 -0
- apex_dispatch_api_client-0.7.2.dist-info/METADATA +167 -0
- apex_dispatch_api_client-0.7.2.dist-info/RECORD +71 -0
- apex_dispatch_api_client-0.7.2.dist-info/WHEEL +4 -0
- apex_dispatch_api_client-0.7.2.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="BaseJobRequestParameters")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class BaseJobRequestParameters:
|
|
14
|
+
"""JSON representing the parameters for the service execution"""
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, Any] = _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: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
27
|
+
d = dict(src_dict)
|
|
28
|
+
base_job_request_parameters = cls()
|
|
29
|
+
|
|
30
|
+
base_job_request_parameters.additional_properties = d
|
|
31
|
+
return base_job_request_parameters
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def additional_keys(self) -> list[str]:
|
|
35
|
+
return list(self.additional_properties.keys())
|
|
36
|
+
|
|
37
|
+
def __getitem__(self, key: str) -> Any:
|
|
38
|
+
return self.additional_properties[key]
|
|
39
|
+
|
|
40
|
+
def __setitem__(self, key: str, value: Any) -> 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,332 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import (
|
|
5
|
+
TYPE_CHECKING,
|
|
6
|
+
Any,
|
|
7
|
+
Literal,
|
|
8
|
+
TypeVar,
|
|
9
|
+
cast,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from attrs import define as _attrs_define
|
|
13
|
+
from attrs import field as _attrs_field
|
|
14
|
+
|
|
15
|
+
from ..types import UNSET, Unset
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from ..models.collection_assets_type_0 import CollectionAssetsType0
|
|
19
|
+
from ..models.collection_summaries_type_0 import CollectionSummariesType0
|
|
20
|
+
from ..models.extent import Extent
|
|
21
|
+
from ..models.link import Link
|
|
22
|
+
from ..models.provider import Provider
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
T = TypeVar("T", bound="Collection")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@_attrs_define
|
|
29
|
+
class Collection:
|
|
30
|
+
"""https://github.com/radiantearth/stac-spec/blob/v1.0.0/collection-spec/collection-spec.md
|
|
31
|
+
|
|
32
|
+
Attributes:
|
|
33
|
+
id (str):
|
|
34
|
+
description (str):
|
|
35
|
+
links (list[Link]):
|
|
36
|
+
type_ (Literal['Collection']):
|
|
37
|
+
license_ (str):
|
|
38
|
+
extent (Extent): https://github.com/radiantearth/stac-spec/blob/v1.0.0/collection-spec/collection-
|
|
39
|
+
spec.md#extent-object
|
|
40
|
+
stac_version (str | Unset): Default: '1.0.0'.
|
|
41
|
+
stac_extensions (list[str] | None | Unset):
|
|
42
|
+
title (None | str | Unset):
|
|
43
|
+
assets (CollectionAssetsType0 | None | Unset):
|
|
44
|
+
keywords (list[str] | None | Unset):
|
|
45
|
+
providers (list[Provider] | None | Unset):
|
|
46
|
+
summaries (CollectionSummariesType0 | None | Unset):
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
id: str
|
|
50
|
+
description: str
|
|
51
|
+
links: list[Link]
|
|
52
|
+
type_: Literal["Collection"]
|
|
53
|
+
license_: str
|
|
54
|
+
extent: Extent
|
|
55
|
+
stac_version: str | Unset = "1.0.0"
|
|
56
|
+
stac_extensions: list[str] | None | Unset = UNSET
|
|
57
|
+
title: None | str | Unset = UNSET
|
|
58
|
+
assets: CollectionAssetsType0 | None | Unset = UNSET
|
|
59
|
+
keywords: list[str] | None | Unset = UNSET
|
|
60
|
+
providers: list[Provider] | None | Unset = UNSET
|
|
61
|
+
summaries: CollectionSummariesType0 | None | Unset = UNSET
|
|
62
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> dict[str, Any]:
|
|
65
|
+
from ..models.collection_assets_type_0 import CollectionAssetsType0
|
|
66
|
+
from ..models.collection_summaries_type_0 import CollectionSummariesType0
|
|
67
|
+
|
|
68
|
+
id = self.id
|
|
69
|
+
|
|
70
|
+
description = self.description
|
|
71
|
+
|
|
72
|
+
links = []
|
|
73
|
+
for componentsschemas_links_item_data in self.links:
|
|
74
|
+
componentsschemas_links_item = componentsschemas_links_item_data.to_dict()
|
|
75
|
+
links.append(componentsschemas_links_item)
|
|
76
|
+
|
|
77
|
+
type_ = self.type_
|
|
78
|
+
|
|
79
|
+
license_ = self.license_
|
|
80
|
+
|
|
81
|
+
extent = self.extent.to_dict()
|
|
82
|
+
|
|
83
|
+
stac_version = self.stac_version
|
|
84
|
+
|
|
85
|
+
stac_extensions: list[str] | None | Unset
|
|
86
|
+
if isinstance(self.stac_extensions, Unset):
|
|
87
|
+
stac_extensions = UNSET
|
|
88
|
+
elif isinstance(self.stac_extensions, list):
|
|
89
|
+
stac_extensions = self.stac_extensions
|
|
90
|
+
|
|
91
|
+
else:
|
|
92
|
+
stac_extensions = self.stac_extensions
|
|
93
|
+
|
|
94
|
+
title: None | str | Unset
|
|
95
|
+
if isinstance(self.title, Unset):
|
|
96
|
+
title = UNSET
|
|
97
|
+
else:
|
|
98
|
+
title = self.title
|
|
99
|
+
|
|
100
|
+
assets: dict[str, Any] | None | Unset
|
|
101
|
+
if isinstance(self.assets, Unset):
|
|
102
|
+
assets = UNSET
|
|
103
|
+
elif isinstance(self.assets, CollectionAssetsType0):
|
|
104
|
+
assets = self.assets.to_dict()
|
|
105
|
+
else:
|
|
106
|
+
assets = self.assets
|
|
107
|
+
|
|
108
|
+
keywords: list[str] | None | Unset
|
|
109
|
+
if isinstance(self.keywords, Unset):
|
|
110
|
+
keywords = UNSET
|
|
111
|
+
elif isinstance(self.keywords, list):
|
|
112
|
+
keywords = self.keywords
|
|
113
|
+
|
|
114
|
+
else:
|
|
115
|
+
keywords = self.keywords
|
|
116
|
+
|
|
117
|
+
providers: list[dict[str, Any]] | None | Unset
|
|
118
|
+
if isinstance(self.providers, Unset):
|
|
119
|
+
providers = UNSET
|
|
120
|
+
elif isinstance(self.providers, list):
|
|
121
|
+
providers = []
|
|
122
|
+
for providers_type_0_item_data in self.providers:
|
|
123
|
+
providers_type_0_item = providers_type_0_item_data.to_dict()
|
|
124
|
+
providers.append(providers_type_0_item)
|
|
125
|
+
|
|
126
|
+
else:
|
|
127
|
+
providers = self.providers
|
|
128
|
+
|
|
129
|
+
summaries: dict[str, Any] | None | Unset
|
|
130
|
+
if isinstance(self.summaries, Unset):
|
|
131
|
+
summaries = UNSET
|
|
132
|
+
elif isinstance(self.summaries, CollectionSummariesType0):
|
|
133
|
+
summaries = self.summaries.to_dict()
|
|
134
|
+
else:
|
|
135
|
+
summaries = self.summaries
|
|
136
|
+
|
|
137
|
+
field_dict: dict[str, Any] = {}
|
|
138
|
+
field_dict.update(self.additional_properties)
|
|
139
|
+
field_dict.update(
|
|
140
|
+
{
|
|
141
|
+
"id": id,
|
|
142
|
+
"description": description,
|
|
143
|
+
"links": links,
|
|
144
|
+
"type": type_,
|
|
145
|
+
"license": license_,
|
|
146
|
+
"extent": extent,
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
if stac_version is not UNSET:
|
|
150
|
+
field_dict["stac_version"] = stac_version
|
|
151
|
+
if stac_extensions is not UNSET:
|
|
152
|
+
field_dict["stac_extensions"] = stac_extensions
|
|
153
|
+
if title is not UNSET:
|
|
154
|
+
field_dict["title"] = title
|
|
155
|
+
if assets is not UNSET:
|
|
156
|
+
field_dict["assets"] = assets
|
|
157
|
+
if keywords is not UNSET:
|
|
158
|
+
field_dict["keywords"] = keywords
|
|
159
|
+
if providers is not UNSET:
|
|
160
|
+
field_dict["providers"] = providers
|
|
161
|
+
if summaries is not UNSET:
|
|
162
|
+
field_dict["summaries"] = summaries
|
|
163
|
+
|
|
164
|
+
return field_dict
|
|
165
|
+
|
|
166
|
+
@classmethod
|
|
167
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
168
|
+
from ..models.collection_assets_type_0 import CollectionAssetsType0
|
|
169
|
+
from ..models.collection_summaries_type_0 import CollectionSummariesType0
|
|
170
|
+
from ..models.extent import Extent
|
|
171
|
+
from ..models.link import Link
|
|
172
|
+
from ..models.provider import Provider
|
|
173
|
+
|
|
174
|
+
d = dict(src_dict)
|
|
175
|
+
id = d.pop("id")
|
|
176
|
+
|
|
177
|
+
description = d.pop("description")
|
|
178
|
+
|
|
179
|
+
links = []
|
|
180
|
+
_links = d.pop("links")
|
|
181
|
+
for componentsschemas_links_item_data in _links:
|
|
182
|
+
componentsschemas_links_item = Link.from_dict(
|
|
183
|
+
componentsschemas_links_item_data
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
links.append(componentsschemas_links_item)
|
|
187
|
+
|
|
188
|
+
type_ = cast(Literal["Collection"], d.pop("type"))
|
|
189
|
+
if type_ != "Collection":
|
|
190
|
+
raise ValueError(f"type must match const 'Collection', got '{type_}'")
|
|
191
|
+
|
|
192
|
+
license_ = d.pop("license")
|
|
193
|
+
|
|
194
|
+
extent = Extent.from_dict(d.pop("extent"))
|
|
195
|
+
|
|
196
|
+
stac_version = d.pop("stac_version", UNSET)
|
|
197
|
+
|
|
198
|
+
def _parse_stac_extensions(data: object) -> list[str] | None | Unset:
|
|
199
|
+
if data is None:
|
|
200
|
+
return data
|
|
201
|
+
if isinstance(data, Unset):
|
|
202
|
+
return data
|
|
203
|
+
try:
|
|
204
|
+
if not isinstance(data, list):
|
|
205
|
+
raise TypeError()
|
|
206
|
+
stac_extensions_type_0 = cast(list[str], data)
|
|
207
|
+
|
|
208
|
+
return stac_extensions_type_0
|
|
209
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
210
|
+
pass
|
|
211
|
+
return cast(list[str] | None | Unset, data)
|
|
212
|
+
|
|
213
|
+
stac_extensions = _parse_stac_extensions(d.pop("stac_extensions", UNSET))
|
|
214
|
+
|
|
215
|
+
def _parse_title(data: object) -> None | str | Unset:
|
|
216
|
+
if data is None:
|
|
217
|
+
return data
|
|
218
|
+
if isinstance(data, Unset):
|
|
219
|
+
return data
|
|
220
|
+
return cast(None | str | Unset, data)
|
|
221
|
+
|
|
222
|
+
title = _parse_title(d.pop("title", UNSET))
|
|
223
|
+
|
|
224
|
+
def _parse_assets(data: object) -> CollectionAssetsType0 | None | Unset:
|
|
225
|
+
if data is None:
|
|
226
|
+
return data
|
|
227
|
+
if isinstance(data, Unset):
|
|
228
|
+
return data
|
|
229
|
+
try:
|
|
230
|
+
if not isinstance(data, dict):
|
|
231
|
+
raise TypeError()
|
|
232
|
+
assets_type_0 = CollectionAssetsType0.from_dict(data)
|
|
233
|
+
|
|
234
|
+
return assets_type_0
|
|
235
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
236
|
+
pass
|
|
237
|
+
return cast(CollectionAssetsType0 | None | Unset, data)
|
|
238
|
+
|
|
239
|
+
assets = _parse_assets(d.pop("assets", UNSET))
|
|
240
|
+
|
|
241
|
+
def _parse_keywords(data: object) -> list[str] | None | Unset:
|
|
242
|
+
if data is None:
|
|
243
|
+
return data
|
|
244
|
+
if isinstance(data, Unset):
|
|
245
|
+
return data
|
|
246
|
+
try:
|
|
247
|
+
if not isinstance(data, list):
|
|
248
|
+
raise TypeError()
|
|
249
|
+
keywords_type_0 = cast(list[str], data)
|
|
250
|
+
|
|
251
|
+
return keywords_type_0
|
|
252
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
253
|
+
pass
|
|
254
|
+
return cast(list[str] | None | Unset, data)
|
|
255
|
+
|
|
256
|
+
keywords = _parse_keywords(d.pop("keywords", UNSET))
|
|
257
|
+
|
|
258
|
+
def _parse_providers(data: object) -> list[Provider] | None | Unset:
|
|
259
|
+
if data is None:
|
|
260
|
+
return data
|
|
261
|
+
if isinstance(data, Unset):
|
|
262
|
+
return data
|
|
263
|
+
try:
|
|
264
|
+
if not isinstance(data, list):
|
|
265
|
+
raise TypeError()
|
|
266
|
+
providers_type_0 = []
|
|
267
|
+
_providers_type_0 = data
|
|
268
|
+
for providers_type_0_item_data in _providers_type_0:
|
|
269
|
+
providers_type_0_item = Provider.from_dict(
|
|
270
|
+
providers_type_0_item_data
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
providers_type_0.append(providers_type_0_item)
|
|
274
|
+
|
|
275
|
+
return providers_type_0
|
|
276
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
277
|
+
pass
|
|
278
|
+
return cast(list[Provider] | None | Unset, data)
|
|
279
|
+
|
|
280
|
+
providers = _parse_providers(d.pop("providers", UNSET))
|
|
281
|
+
|
|
282
|
+
def _parse_summaries(data: object) -> CollectionSummariesType0 | None | Unset:
|
|
283
|
+
if data is None:
|
|
284
|
+
return data
|
|
285
|
+
if isinstance(data, Unset):
|
|
286
|
+
return data
|
|
287
|
+
try:
|
|
288
|
+
if not isinstance(data, dict):
|
|
289
|
+
raise TypeError()
|
|
290
|
+
summaries_type_0 = CollectionSummariesType0.from_dict(data)
|
|
291
|
+
|
|
292
|
+
return summaries_type_0
|
|
293
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
294
|
+
pass
|
|
295
|
+
return cast(CollectionSummariesType0 | None | Unset, data)
|
|
296
|
+
|
|
297
|
+
summaries = _parse_summaries(d.pop("summaries", UNSET))
|
|
298
|
+
|
|
299
|
+
collection = cls(
|
|
300
|
+
id=id,
|
|
301
|
+
description=description,
|
|
302
|
+
links=links,
|
|
303
|
+
type_=type_,
|
|
304
|
+
license_=license_,
|
|
305
|
+
extent=extent,
|
|
306
|
+
stac_version=stac_version,
|
|
307
|
+
stac_extensions=stac_extensions,
|
|
308
|
+
title=title,
|
|
309
|
+
assets=assets,
|
|
310
|
+
keywords=keywords,
|
|
311
|
+
providers=providers,
|
|
312
|
+
summaries=summaries,
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
collection.additional_properties = d
|
|
316
|
+
return collection
|
|
317
|
+
|
|
318
|
+
@property
|
|
319
|
+
def additional_keys(self) -> list[str]:
|
|
320
|
+
return list(self.additional_properties.keys())
|
|
321
|
+
|
|
322
|
+
def __getitem__(self, key: str) -> Any:
|
|
323
|
+
return self.additional_properties[key]
|
|
324
|
+
|
|
325
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
326
|
+
self.additional_properties[key] = value
|
|
327
|
+
|
|
328
|
+
def __delitem__(self, key: str) -> None:
|
|
329
|
+
del self.additional_properties[key]
|
|
330
|
+
|
|
331
|
+
def __contains__(self, key: str) -> bool:
|
|
332
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, 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.asset import Asset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="CollectionAssetsType0")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class CollectionAssetsType0:
|
|
18
|
+
""" """
|
|
19
|
+
|
|
20
|
+
additional_properties: dict[str, Asset] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
|
|
24
|
+
field_dict: dict[str, Any] = {}
|
|
25
|
+
for prop_name, prop in self.additional_properties.items():
|
|
26
|
+
field_dict[prop_name] = prop.to_dict()
|
|
27
|
+
|
|
28
|
+
return field_dict
|
|
29
|
+
|
|
30
|
+
@classmethod
|
|
31
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
32
|
+
from ..models.asset import Asset
|
|
33
|
+
|
|
34
|
+
d = dict(src_dict)
|
|
35
|
+
collection_assets_type_0 = cls()
|
|
36
|
+
|
|
37
|
+
additional_properties = {}
|
|
38
|
+
for prop_name, prop_dict in d.items():
|
|
39
|
+
additional_property = Asset.from_dict(prop_dict)
|
|
40
|
+
|
|
41
|
+
additional_properties[prop_name] = additional_property
|
|
42
|
+
|
|
43
|
+
collection_assets_type_0.additional_properties = additional_properties
|
|
44
|
+
return collection_assets_type_0
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def additional_keys(self) -> list[str]:
|
|
48
|
+
return list(self.additional_properties.keys())
|
|
49
|
+
|
|
50
|
+
def __getitem__(self, key: str) -> Asset:
|
|
51
|
+
return self.additional_properties[key]
|
|
52
|
+
|
|
53
|
+
def __setitem__(self, key: str, value: Asset) -> None:
|
|
54
|
+
self.additional_properties[key] = value
|
|
55
|
+
|
|
56
|
+
def __delitem__(self, key: str) -> None:
|
|
57
|
+
del self.additional_properties[key]
|
|
58
|
+
|
|
59
|
+
def __contains__(self, key: str) -> bool:
|
|
60
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
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.collection_summaries_type_0_additional_property_type_2 import (
|
|
11
|
+
CollectionSummariesType0AdditionalPropertyType2,
|
|
12
|
+
)
|
|
13
|
+
from ..models.range_ import Range
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="CollectionSummariesType0")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class CollectionSummariesType0:
|
|
21
|
+
""" """
|
|
22
|
+
|
|
23
|
+
additional_properties: dict[
|
|
24
|
+
str, CollectionSummariesType0AdditionalPropertyType2 | list[Any] | Range
|
|
25
|
+
] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
from ..models.range_ import Range
|
|
29
|
+
|
|
30
|
+
field_dict: dict[str, Any] = {}
|
|
31
|
+
for prop_name, prop in self.additional_properties.items():
|
|
32
|
+
if isinstance(prop, Range):
|
|
33
|
+
field_dict[prop_name] = prop.to_dict()
|
|
34
|
+
elif isinstance(prop, list):
|
|
35
|
+
field_dict[prop_name] = prop
|
|
36
|
+
|
|
37
|
+
else:
|
|
38
|
+
field_dict[prop_name] = prop.to_dict()
|
|
39
|
+
|
|
40
|
+
return field_dict
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
44
|
+
from ..models.collection_summaries_type_0_additional_property_type_2 import (
|
|
45
|
+
CollectionSummariesType0AdditionalPropertyType2,
|
|
46
|
+
)
|
|
47
|
+
from ..models.range_ import Range
|
|
48
|
+
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
collection_summaries_type_0 = cls()
|
|
51
|
+
|
|
52
|
+
additional_properties = {}
|
|
53
|
+
for prop_name, prop_dict in d.items():
|
|
54
|
+
|
|
55
|
+
def _parse_additional_property(
|
|
56
|
+
data: object,
|
|
57
|
+
) -> CollectionSummariesType0AdditionalPropertyType2 | list[Any] | Range:
|
|
58
|
+
try:
|
|
59
|
+
if not isinstance(data, dict):
|
|
60
|
+
raise TypeError()
|
|
61
|
+
additional_property_type_0 = Range.from_dict(data)
|
|
62
|
+
|
|
63
|
+
return additional_property_type_0
|
|
64
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
65
|
+
pass
|
|
66
|
+
try:
|
|
67
|
+
if not isinstance(data, list):
|
|
68
|
+
raise TypeError()
|
|
69
|
+
additional_property_type_1 = cast(list[Any], data)
|
|
70
|
+
|
|
71
|
+
return additional_property_type_1
|
|
72
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
73
|
+
pass
|
|
74
|
+
if not isinstance(data, dict):
|
|
75
|
+
raise TypeError()
|
|
76
|
+
additional_property_type_2 = (
|
|
77
|
+
CollectionSummariesType0AdditionalPropertyType2.from_dict(data)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return additional_property_type_2
|
|
81
|
+
|
|
82
|
+
additional_property = _parse_additional_property(prop_dict)
|
|
83
|
+
|
|
84
|
+
additional_properties[prop_name] = additional_property
|
|
85
|
+
|
|
86
|
+
collection_summaries_type_0.additional_properties = additional_properties
|
|
87
|
+
return collection_summaries_type_0
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def additional_keys(self) -> list[str]:
|
|
91
|
+
return list(self.additional_properties.keys())
|
|
92
|
+
|
|
93
|
+
def __getitem__(
|
|
94
|
+
self, key: str
|
|
95
|
+
) -> CollectionSummariesType0AdditionalPropertyType2 | list[Any] | Range:
|
|
96
|
+
return self.additional_properties[key]
|
|
97
|
+
|
|
98
|
+
def __setitem__(
|
|
99
|
+
self,
|
|
100
|
+
key: str,
|
|
101
|
+
value: CollectionSummariesType0AdditionalPropertyType2 | list[Any] | Range,
|
|
102
|
+
) -> None:
|
|
103
|
+
self.additional_properties[key] = value
|
|
104
|
+
|
|
105
|
+
def __delitem__(self, key: str) -> None:
|
|
106
|
+
del self.additional_properties[key]
|
|
107
|
+
|
|
108
|
+
def __contains__(self, key: str) -> bool:
|
|
109
|
+
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, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="CollectionSummariesType0AdditionalPropertyType2")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class CollectionSummariesType0AdditionalPropertyType2:
|
|
14
|
+
""" """
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, Any] = _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: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
27
|
+
d = dict(src_dict)
|
|
28
|
+
collection_summaries_type_0_additional_property_type_2 = cls()
|
|
29
|
+
|
|
30
|
+
collection_summaries_type_0_additional_property_type_2.additional_properties = d
|
|
31
|
+
return collection_summaries_type_0_additional_property_type_2
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def additional_keys(self) -> list[str]:
|
|
35
|
+
return list(self.additional_properties.keys())
|
|
36
|
+
|
|
37
|
+
def __getitem__(self, key: str) -> Any:
|
|
38
|
+
return self.additional_properties[key]
|
|
39
|
+
|
|
40
|
+
def __setitem__(self, key: str, value: Any) -> 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
|