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,138 @@
|
|
|
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
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.error_response_details_type_0 import ErrorResponseDetailsType0
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="ErrorResponse")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class ErrorResponse:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
error_code (str):
|
|
23
|
+
message (str):
|
|
24
|
+
status (str | Unset): Default: 'error'.
|
|
25
|
+
details (ErrorResponseDetailsType0 | None | Unset):
|
|
26
|
+
request_id (None | str | Unset):
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
error_code: str
|
|
30
|
+
message: str
|
|
31
|
+
status: str | Unset = "error"
|
|
32
|
+
details: ErrorResponseDetailsType0 | None | Unset = UNSET
|
|
33
|
+
request_id: None | str | Unset = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
from ..models.error_response_details_type_0 import ErrorResponseDetailsType0
|
|
38
|
+
|
|
39
|
+
error_code = self.error_code
|
|
40
|
+
|
|
41
|
+
message = self.message
|
|
42
|
+
|
|
43
|
+
status = self.status
|
|
44
|
+
|
|
45
|
+
details: dict[str, Any] | None | Unset
|
|
46
|
+
if isinstance(self.details, Unset):
|
|
47
|
+
details = UNSET
|
|
48
|
+
elif isinstance(self.details, ErrorResponseDetailsType0):
|
|
49
|
+
details = self.details.to_dict()
|
|
50
|
+
else:
|
|
51
|
+
details = self.details
|
|
52
|
+
|
|
53
|
+
request_id: None | str | Unset
|
|
54
|
+
if isinstance(self.request_id, Unset):
|
|
55
|
+
request_id = UNSET
|
|
56
|
+
else:
|
|
57
|
+
request_id = self.request_id
|
|
58
|
+
|
|
59
|
+
field_dict: dict[str, Any] = {}
|
|
60
|
+
field_dict.update(self.additional_properties)
|
|
61
|
+
field_dict.update(
|
|
62
|
+
{
|
|
63
|
+
"error_code": error_code,
|
|
64
|
+
"message": message,
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
if status is not UNSET:
|
|
68
|
+
field_dict["status"] = status
|
|
69
|
+
if details is not UNSET:
|
|
70
|
+
field_dict["details"] = details
|
|
71
|
+
if request_id is not UNSET:
|
|
72
|
+
field_dict["request_id"] = request_id
|
|
73
|
+
|
|
74
|
+
return field_dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
78
|
+
from ..models.error_response_details_type_0 import ErrorResponseDetailsType0
|
|
79
|
+
|
|
80
|
+
d = dict(src_dict)
|
|
81
|
+
error_code = d.pop("error_code")
|
|
82
|
+
|
|
83
|
+
message = d.pop("message")
|
|
84
|
+
|
|
85
|
+
status = d.pop("status", UNSET)
|
|
86
|
+
|
|
87
|
+
def _parse_details(data: object) -> ErrorResponseDetailsType0 | None | Unset:
|
|
88
|
+
if data is None:
|
|
89
|
+
return data
|
|
90
|
+
if isinstance(data, Unset):
|
|
91
|
+
return data
|
|
92
|
+
try:
|
|
93
|
+
if not isinstance(data, dict):
|
|
94
|
+
raise TypeError()
|
|
95
|
+
details_type_0 = ErrorResponseDetailsType0.from_dict(data)
|
|
96
|
+
|
|
97
|
+
return details_type_0
|
|
98
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
99
|
+
pass
|
|
100
|
+
return cast(ErrorResponseDetailsType0 | None | Unset, data)
|
|
101
|
+
|
|
102
|
+
details = _parse_details(d.pop("details", UNSET))
|
|
103
|
+
|
|
104
|
+
def _parse_request_id(data: object) -> None | str | Unset:
|
|
105
|
+
if data is None:
|
|
106
|
+
return data
|
|
107
|
+
if isinstance(data, Unset):
|
|
108
|
+
return data
|
|
109
|
+
return cast(None | str | Unset, data)
|
|
110
|
+
|
|
111
|
+
request_id = _parse_request_id(d.pop("request_id", UNSET))
|
|
112
|
+
|
|
113
|
+
error_response = cls(
|
|
114
|
+
error_code=error_code,
|
|
115
|
+
message=message,
|
|
116
|
+
status=status,
|
|
117
|
+
details=details,
|
|
118
|
+
request_id=request_id,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
error_response.additional_properties = d
|
|
122
|
+
return error_response
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def additional_keys(self) -> list[str]:
|
|
126
|
+
return list(self.additional_properties.keys())
|
|
127
|
+
|
|
128
|
+
def __getitem__(self, key: str) -> Any:
|
|
129
|
+
return self.additional_properties[key]
|
|
130
|
+
|
|
131
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
132
|
+
self.additional_properties[key] = value
|
|
133
|
+
|
|
134
|
+
def __delitem__(self, key: str) -> None:
|
|
135
|
+
del self.additional_properties[key]
|
|
136
|
+
|
|
137
|
+
def __contains__(self, key: str) -> bool:
|
|
138
|
+
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="ErrorResponseDetailsType0")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ErrorResponseDetailsType0:
|
|
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
|
+
error_response_details_type_0 = cls()
|
|
29
|
+
|
|
30
|
+
error_response_details_type_0.additional_properties = d
|
|
31
|
+
return error_response_details_type_0
|
|
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,80 @@
|
|
|
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.spatial_extent import SpatialExtent
|
|
11
|
+
from ..models.time_interval import TimeInterval
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
T = TypeVar("T", bound="Extent")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@_attrs_define
|
|
18
|
+
class Extent:
|
|
19
|
+
"""https://github.com/radiantearth/stac-spec/blob/v1.0.0/collection-spec/collection-spec.md#extent-object
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
spatial (SpatialExtent): https://github.com/radiantearth/stac-spec/blob/v1.0.0/collection-spec/collection-
|
|
23
|
+
spec.md#spatial-extent-object
|
|
24
|
+
temporal (TimeInterval): https://github.com/radiantearth/stac-spec/blob/v1.0.0/collection-spec/collection-
|
|
25
|
+
spec.md#temporal-extent-object
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
spatial: SpatialExtent
|
|
29
|
+
temporal: TimeInterval
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
|
33
|
+
spatial = self.spatial.to_dict()
|
|
34
|
+
|
|
35
|
+
temporal = self.temporal.to_dict()
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update(
|
|
40
|
+
{
|
|
41
|
+
"spatial": spatial,
|
|
42
|
+
"temporal": temporal,
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
return field_dict
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
50
|
+
from ..models.spatial_extent import SpatialExtent
|
|
51
|
+
from ..models.time_interval import TimeInterval
|
|
52
|
+
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
spatial = SpatialExtent.from_dict(d.pop("spatial"))
|
|
55
|
+
|
|
56
|
+
temporal = TimeInterval.from_dict(d.pop("temporal"))
|
|
57
|
+
|
|
58
|
+
extent = cls(
|
|
59
|
+
spatial=spatial,
|
|
60
|
+
temporal=temporal,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
extent.additional_properties = d
|
|
64
|
+
return extent
|
|
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,247 @@
|
|
|
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.line_string import LineString
|
|
19
|
+
from ..models.multi_line_string import MultiLineString
|
|
20
|
+
from ..models.multi_point import MultiPoint
|
|
21
|
+
from ..models.multi_polygon import MultiPolygon
|
|
22
|
+
from ..models.point import Point
|
|
23
|
+
from ..models.polygon import Polygon
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
T = TypeVar("T", bound="GeometryCollection")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@_attrs_define
|
|
30
|
+
class GeometryCollection:
|
|
31
|
+
"""GeometryCollection Model
|
|
32
|
+
|
|
33
|
+
Attributes:
|
|
34
|
+
type_ (Literal['GeometryCollection']):
|
|
35
|
+
geometries (list[GeometryCollection | LineString | MultiLineString | MultiPoint | MultiPolygon | Point |
|
|
36
|
+
Polygon]):
|
|
37
|
+
bbox (list[float] | None | Unset):
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
type_: Literal["GeometryCollection"]
|
|
41
|
+
geometries: list[
|
|
42
|
+
GeometryCollection
|
|
43
|
+
| LineString
|
|
44
|
+
| MultiLineString
|
|
45
|
+
| MultiPoint
|
|
46
|
+
| MultiPolygon
|
|
47
|
+
| Point
|
|
48
|
+
| Polygon
|
|
49
|
+
]
|
|
50
|
+
bbox: list[float] | None | Unset = UNSET
|
|
51
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> dict[str, Any]:
|
|
54
|
+
from ..models.line_string import LineString
|
|
55
|
+
from ..models.multi_line_string import MultiLineString
|
|
56
|
+
from ..models.multi_point import MultiPoint
|
|
57
|
+
from ..models.multi_polygon import MultiPolygon
|
|
58
|
+
from ..models.point import Point
|
|
59
|
+
from ..models.polygon import Polygon
|
|
60
|
+
|
|
61
|
+
type_ = self.type_
|
|
62
|
+
|
|
63
|
+
geometries = []
|
|
64
|
+
for geometries_item_data in self.geometries:
|
|
65
|
+
geometries_item: dict[str, Any]
|
|
66
|
+
if isinstance(geometries_item_data, Point):
|
|
67
|
+
geometries_item = geometries_item_data.to_dict()
|
|
68
|
+
elif isinstance(geometries_item_data, MultiPoint):
|
|
69
|
+
geometries_item = geometries_item_data.to_dict()
|
|
70
|
+
elif isinstance(geometries_item_data, LineString):
|
|
71
|
+
geometries_item = geometries_item_data.to_dict()
|
|
72
|
+
elif isinstance(geometries_item_data, MultiLineString):
|
|
73
|
+
geometries_item = geometries_item_data.to_dict()
|
|
74
|
+
elif isinstance(geometries_item_data, Polygon):
|
|
75
|
+
geometries_item = geometries_item_data.to_dict()
|
|
76
|
+
elif isinstance(geometries_item_data, MultiPolygon):
|
|
77
|
+
geometries_item = geometries_item_data.to_dict()
|
|
78
|
+
else:
|
|
79
|
+
geometries_item = geometries_item_data.to_dict()
|
|
80
|
+
|
|
81
|
+
geometries.append(geometries_item)
|
|
82
|
+
|
|
83
|
+
bbox: list[float] | None | Unset
|
|
84
|
+
if isinstance(self.bbox, Unset):
|
|
85
|
+
bbox = UNSET
|
|
86
|
+
elif isinstance(self.bbox, list):
|
|
87
|
+
bbox = []
|
|
88
|
+
for bbox_type_0_item_data in self.bbox:
|
|
89
|
+
bbox_type_0_item: float
|
|
90
|
+
bbox_type_0_item = bbox_type_0_item_data
|
|
91
|
+
bbox.append(bbox_type_0_item)
|
|
92
|
+
|
|
93
|
+
else:
|
|
94
|
+
bbox = self.bbox
|
|
95
|
+
|
|
96
|
+
field_dict: dict[str, Any] = {}
|
|
97
|
+
field_dict.update(self.additional_properties)
|
|
98
|
+
field_dict.update(
|
|
99
|
+
{
|
|
100
|
+
"type": type_,
|
|
101
|
+
"geometries": geometries,
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
if bbox is not UNSET:
|
|
105
|
+
field_dict["bbox"] = bbox
|
|
106
|
+
|
|
107
|
+
return field_dict
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
111
|
+
from ..models.line_string import LineString
|
|
112
|
+
from ..models.multi_line_string import MultiLineString
|
|
113
|
+
from ..models.multi_point import MultiPoint
|
|
114
|
+
from ..models.multi_polygon import MultiPolygon
|
|
115
|
+
from ..models.point import Point
|
|
116
|
+
from ..models.polygon import Polygon
|
|
117
|
+
|
|
118
|
+
d = dict(src_dict)
|
|
119
|
+
type_ = cast(Literal["GeometryCollection"], d.pop("type"))
|
|
120
|
+
if type_ != "GeometryCollection":
|
|
121
|
+
raise ValueError(
|
|
122
|
+
f"type must match const 'GeometryCollection', got '{type_}'"
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
geometries = []
|
|
126
|
+
_geometries = d.pop("geometries")
|
|
127
|
+
for geometries_item_data in _geometries:
|
|
128
|
+
|
|
129
|
+
def _parse_geometries_item(
|
|
130
|
+
data: object,
|
|
131
|
+
) -> (
|
|
132
|
+
GeometryCollection
|
|
133
|
+
| LineString
|
|
134
|
+
| MultiLineString
|
|
135
|
+
| MultiPoint
|
|
136
|
+
| MultiPolygon
|
|
137
|
+
| Point
|
|
138
|
+
| Polygon
|
|
139
|
+
):
|
|
140
|
+
try:
|
|
141
|
+
if not isinstance(data, dict):
|
|
142
|
+
raise TypeError()
|
|
143
|
+
geometries_item_type_0 = Point.from_dict(data)
|
|
144
|
+
|
|
145
|
+
return geometries_item_type_0
|
|
146
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
147
|
+
pass
|
|
148
|
+
try:
|
|
149
|
+
if not isinstance(data, dict):
|
|
150
|
+
raise TypeError()
|
|
151
|
+
geometries_item_type_1 = MultiPoint.from_dict(data)
|
|
152
|
+
|
|
153
|
+
return geometries_item_type_1
|
|
154
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
155
|
+
pass
|
|
156
|
+
try:
|
|
157
|
+
if not isinstance(data, dict):
|
|
158
|
+
raise TypeError()
|
|
159
|
+
geometries_item_type_2 = LineString.from_dict(data)
|
|
160
|
+
|
|
161
|
+
return geometries_item_type_2
|
|
162
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
163
|
+
pass
|
|
164
|
+
try:
|
|
165
|
+
if not isinstance(data, dict):
|
|
166
|
+
raise TypeError()
|
|
167
|
+
geometries_item_type_3 = MultiLineString.from_dict(data)
|
|
168
|
+
|
|
169
|
+
return geometries_item_type_3
|
|
170
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
171
|
+
pass
|
|
172
|
+
try:
|
|
173
|
+
if not isinstance(data, dict):
|
|
174
|
+
raise TypeError()
|
|
175
|
+
geometries_item_type_4 = Polygon.from_dict(data)
|
|
176
|
+
|
|
177
|
+
return geometries_item_type_4
|
|
178
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
179
|
+
pass
|
|
180
|
+
try:
|
|
181
|
+
if not isinstance(data, dict):
|
|
182
|
+
raise TypeError()
|
|
183
|
+
geometries_item_type_5 = MultiPolygon.from_dict(data)
|
|
184
|
+
|
|
185
|
+
return geometries_item_type_5
|
|
186
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
187
|
+
pass
|
|
188
|
+
if not isinstance(data, dict):
|
|
189
|
+
raise TypeError()
|
|
190
|
+
geometries_item_type_6 = GeometryCollection.from_dict(data)
|
|
191
|
+
|
|
192
|
+
return geometries_item_type_6
|
|
193
|
+
|
|
194
|
+
geometries_item = _parse_geometries_item(geometries_item_data)
|
|
195
|
+
|
|
196
|
+
geometries.append(geometries_item)
|
|
197
|
+
|
|
198
|
+
def _parse_bbox(data: object) -> list[float] | 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
|
+
bbox_type_0 = []
|
|
207
|
+
_bbox_type_0 = data
|
|
208
|
+
for bbox_type_0_item_data in _bbox_type_0:
|
|
209
|
+
|
|
210
|
+
def _parse_bbox_type_0_item(data: object) -> float:
|
|
211
|
+
return cast(float, data)
|
|
212
|
+
|
|
213
|
+
bbox_type_0_item = _parse_bbox_type_0_item(bbox_type_0_item_data)
|
|
214
|
+
|
|
215
|
+
bbox_type_0.append(bbox_type_0_item)
|
|
216
|
+
|
|
217
|
+
return bbox_type_0
|
|
218
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
219
|
+
pass
|
|
220
|
+
return cast(list[float] | None | Unset, data)
|
|
221
|
+
|
|
222
|
+
bbox = _parse_bbox(d.pop("bbox", UNSET))
|
|
223
|
+
|
|
224
|
+
geometry_collection = cls(
|
|
225
|
+
type_=type_,
|
|
226
|
+
geometries=geometries,
|
|
227
|
+
bbox=bbox,
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
geometry_collection.additional_properties = d
|
|
231
|
+
return geometry_collection
|
|
232
|
+
|
|
233
|
+
@property
|
|
234
|
+
def additional_keys(self) -> list[str]:
|
|
235
|
+
return list(self.additional_properties.keys())
|
|
236
|
+
|
|
237
|
+
def __getitem__(self, key: str) -> Any:
|
|
238
|
+
return self.additional_properties[key]
|
|
239
|
+
|
|
240
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
241
|
+
self.additional_properties[key] = value
|
|
242
|
+
|
|
243
|
+
def __delitem__(self, key: str) -> None:
|
|
244
|
+
del self.additional_properties[key]
|
|
245
|
+
|
|
246
|
+
def __contains__(self, key: str) -> bool:
|
|
247
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.validation_error import ValidationError
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="HTTPValidationError")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class HTTPValidationError:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
detail (list[ValidationError] | Unset):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
detail: list[ValidationError] | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
detail: list[dict[str, Any]] | Unset = UNSET
|
|
30
|
+
if not isinstance(self.detail, Unset):
|
|
31
|
+
detail = []
|
|
32
|
+
for detail_item_data in self.detail:
|
|
33
|
+
detail_item = detail_item_data.to_dict()
|
|
34
|
+
detail.append(detail_item)
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update({})
|
|
39
|
+
if detail is not UNSET:
|
|
40
|
+
field_dict["detail"] = detail
|
|
41
|
+
|
|
42
|
+
return field_dict
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
46
|
+
from ..models.validation_error import ValidationError
|
|
47
|
+
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
_detail = d.pop("detail", UNSET)
|
|
50
|
+
detail: list[ValidationError] | Unset = UNSET
|
|
51
|
+
if _detail is not UNSET:
|
|
52
|
+
detail = []
|
|
53
|
+
for detail_item_data in _detail:
|
|
54
|
+
detail_item = ValidationError.from_dict(detail_item_data)
|
|
55
|
+
|
|
56
|
+
detail.append(detail_item)
|
|
57
|
+
|
|
58
|
+
http_validation_error = cls(
|
|
59
|
+
detail=detail,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
http_validation_error.additional_properties = d
|
|
63
|
+
return http_validation_error
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def additional_keys(self) -> list[str]:
|
|
67
|
+
return list(self.additional_properties.keys())
|
|
68
|
+
|
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
|
70
|
+
return self.additional_properties[key]
|
|
71
|
+
|
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
73
|
+
self.additional_properties[key] = value
|
|
74
|
+
|
|
75
|
+
def __delitem__(self, key: str) -> None:
|
|
76
|
+
del self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __contains__(self, key: str) -> bool:
|
|
79
|
+
return key in self.additional_properties
|