stadiamaps 1.0.6__py3-none-any.whl → 2.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.
- stadiamaps/__init__.py +6 -24
- stadiamaps/api/geocoding_api.py +1917 -760
- stadiamaps/api/geospatial_api.py +483 -221
- stadiamaps/api/routing_api.py +1615 -723
- stadiamaps/api_client.py +275 -272
- stadiamaps/api_response.py +12 -16
- stadiamaps/configuration.py +13 -11
- stadiamaps/exceptions.py +67 -30
- stadiamaps/models/__init__.py +5 -23
- stadiamaps/models/access.py +44 -26
- stadiamaps/models/admin_region.py +46 -28
- stadiamaps/models/administrative.py +48 -30
- stadiamaps/models/auto_costing_options.py +69 -48
- stadiamaps/models/auto_costing_options_all_of.py +1 -1
- stadiamaps/models/base_costing_options.py +52 -33
- stadiamaps/models/base_trace_request.py +70 -40
- stadiamaps/models/bicycle_costing_options.py +61 -42
- stadiamaps/models/bicycle_costing_options_all_of.py +1 -1
- stadiamaps/models/bike_network.py +42 -24
- stadiamaps/models/contour.py +45 -27
- stadiamaps/models/coordinate.py +45 -26
- stadiamaps/models/costing_model.py +10 -12
- stadiamaps/models/costing_options.py +51 -33
- stadiamaps/models/directions_options.py +45 -27
- stadiamaps/models/distance_unit.py +8 -11
- stadiamaps/models/edge_sign.py +46 -28
- stadiamaps/models/edge_use.py +8 -11
- stadiamaps/models/end_node.py +48 -30
- stadiamaps/models/geo_attributes.py +47 -29
- stadiamaps/models/geo_json_geometry.py +25 -25
- stadiamaps/models/geo_json_geometry_base.py +45 -27
- stadiamaps/models/geo_json_line_string.py +47 -28
- stadiamaps/models/geo_json_line_string_all_of.py +2 -2
- stadiamaps/models/geo_json_point.py +47 -28
- stadiamaps/models/geo_json_point_all_of.py +2 -2
- stadiamaps/models/geo_json_polygon.py +47 -28
- stadiamaps/models/geo_json_polygon_all_of.py +2 -2
- stadiamaps/models/geocoding_object.py +46 -28
- stadiamaps/models/height_request.py +55 -34
- stadiamaps/models/height_response.py +49 -30
- stadiamaps/models/highway_classification.py +52 -34
- stadiamaps/models/intersecting_edge.py +45 -27
- stadiamaps/models/isochrone_costing_model.py +8 -11
- stadiamaps/models/isochrone_feature.py +45 -27
- stadiamaps/models/isochrone_properties.py +48 -30
- stadiamaps/models/isochrone_request.py +54 -35
- stadiamaps/models/isochrone_response.py +47 -29
- stadiamaps/models/locate_detailed_edge.py +73 -55
- stadiamaps/models/locate_edge.py +56 -39
- stadiamaps/models/locate_edge_info.py +47 -29
- stadiamaps/models/locate_node.py +50 -31
- stadiamaps/models/locate_node_all_of.py +1 -1
- stadiamaps/models/locate_object.py +49 -31
- stadiamaps/models/maneuver_sign.py +50 -32
- stadiamaps/models/maneuver_sign_element.py +45 -27
- stadiamaps/models/map_match_costing_model.py +8 -11
- stadiamaps/models/map_match_request.py +74 -44
- stadiamaps/models/map_match_request_all_of.py +1 -1
- stadiamaps/models/map_match_route_response.py +57 -29
- stadiamaps/models/map_match_route_response_all_of.py +1 -1
- stadiamaps/models/map_match_trace_options.py +47 -29
- stadiamaps/models/map_match_waypoint.py +49 -30
- stadiamaps/models/map_match_waypoint_all_of.py +1 -1
- stadiamaps/models/matched_point.py +52 -34
- stadiamaps/models/matrix_costing_model.py +9 -12
- stadiamaps/models/matrix_distance.py +46 -28
- stadiamaps/models/matrix_request.py +70 -39
- stadiamaps/models/matrix_response.py +60 -36
- stadiamaps/models/motor_scooter_costing_options.py +70 -49
- stadiamaps/models/motor_scooter_costing_options_all_of.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +69 -48
- stadiamaps/models/motorcycle_costing_options_all_of.py +1 -1
- stadiamaps/models/nearest_roads_request.py +65 -34
- stadiamaps/models/node_id.py +42 -24
- stadiamaps/models/node_type.py +8 -11
- stadiamaps/models/optimized_route_request.py +66 -35
- stadiamaps/models/pedestrian_costing_options.py +59 -40
- stadiamaps/models/pelias_geo_json_feature.py +50 -31
- stadiamaps/models/pelias_geo_json_properties.py +54 -36
- stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
- stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
- stadiamaps/models/pelias_layer.py +8 -11
- stadiamaps/models/pelias_response.py +49 -30
- stadiamaps/models/pelias_response_geocoding.py +1 -1
- stadiamaps/models/pelias_source.py +8 -11
- stadiamaps/models/restrictions.py +44 -26
- stadiamaps/models/road_class.py +8 -11
- stadiamaps/models/route_leg.py +48 -29
- stadiamaps/models/route_maneuver.py +73 -55
- stadiamaps/models/route_request.py +76 -43
- stadiamaps/models/route_response.py +56 -28
- stadiamaps/models/route_response_alternates_inner.py +105 -0
- stadiamaps/models/route_response_trip.py +1 -1
- stadiamaps/models/route_summary.py +48 -30
- stadiamaps/models/route_trip.py +135 -0
- stadiamaps/models/routing_response_waypoint.py +49 -30
- stadiamaps/models/routing_response_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint.py +60 -41
- stadiamaps/models/routing_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
- stadiamaps/models/simple_routing_waypoint.py +48 -29
- stadiamaps/models/simple_routing_waypoint_all_of.py +1 -1
- stadiamaps/models/speeds.py +49 -31
- stadiamaps/models/trace_attribute_filter_options.py +47 -28
- stadiamaps/models/trace_attribute_key.py +8 -11
- stadiamaps/models/trace_attributes_base_response.py +51 -32
- stadiamaps/models/trace_attributes_request.py +72 -42
- stadiamaps/models/trace_attributes_request_all_of.py +1 -1
- stadiamaps/models/trace_attributes_request_all_of_filters.py +2 -2
- stadiamaps/models/trace_attributes_response.py +54 -35
- stadiamaps/models/trace_attributes_response_all_of.py +1 -1
- stadiamaps/models/trace_edge.py +88 -70
- stadiamaps/models/travel_mode.py +8 -11
- stadiamaps/models/traversability.py +8 -11
- stadiamaps/models/truck_costing_options.py +72 -51
- stadiamaps/models/truck_costing_options_all_of.py +1 -1
- stadiamaps/models/tz_response.py +45 -27
- stadiamaps/models/valhalla_languages.py +8 -11
- stadiamaps/models/valhalla_long_units.py +8 -11
- stadiamaps/models/warning.py +42 -24
- stadiamaps/py.typed +0 -0
- stadiamaps/rest.py +127 -172
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/METADATA +4 -4
- stadiamaps-2.0.0.dist-info/RECORD +128 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/WHEEL +1 -1
- stadiamaps-1.0.6.dist-info/RECORD +0 -125
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/top_level.txt +0 -0
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,46 +18,63 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
24
25
|
|
25
26
|
class PeliasGeoJSONPropertiesAddendumOsm(BaseModel):
|
26
27
|
"""
|
27
28
|
PeliasGeoJSONPropertiesAddendumOsm
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
29
30
|
website: Optional[StrictStr] = None
|
30
31
|
wikipedia: Optional[StrictStr] = None
|
31
32
|
wikidata: Optional[StrictStr] = None
|
32
33
|
phone: Optional[StrictStr] = None
|
33
34
|
additional_properties: Dict[str, Any] = {}
|
34
|
-
__properties = ["website", "wikipedia", "wikidata", "phone"]
|
35
|
+
__properties: ClassVar[List[str]] = ["website", "wikipedia", "wikidata", "phone"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
35
42
|
|
36
|
-
class Config:
|
37
|
-
"""Pydantic configuration"""
|
38
|
-
allow_population_by_field_name = True
|
39
|
-
validate_assignment = True
|
40
43
|
|
41
44
|
def to_str(self) -> str:
|
42
45
|
"""Returns the string representation of the model using alias"""
|
43
|
-
return pprint.pformat(self.
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
44
47
|
|
45
48
|
def to_json(self) -> str:
|
46
49
|
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
47
51
|
return json.dumps(self.to_dict())
|
48
52
|
|
49
53
|
@classmethod
|
50
|
-
def from_json(cls, json_str: str) ->
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
51
55
|
"""Create an instance of PeliasGeoJSONPropertiesAddendumOsm from a JSON string"""
|
52
56
|
return cls.from_dict(json.loads(json_str))
|
53
57
|
|
54
|
-
def to_dict(self):
|
55
|
-
"""
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
68
|
+
"""
|
69
|
+
excluded_fields: Set[str] = set([
|
70
|
+
"additional_properties",
|
71
|
+
])
|
72
|
+
|
73
|
+
_dict = self.model_dump(
|
74
|
+
by_alias=True,
|
75
|
+
exclude=excluded_fields,
|
76
|
+
exclude_none=True,
|
77
|
+
)
|
61
78
|
# puts key-value pairs in additional_properties in the top level
|
62
79
|
if self.additional_properties is not None:
|
63
80
|
for _key, _value in self.additional_properties.items():
|
@@ -66,15 +83,15 @@ class PeliasGeoJSONPropertiesAddendumOsm(BaseModel):
|
|
66
83
|
return _dict
|
67
84
|
|
68
85
|
@classmethod
|
69
|
-
def from_dict(cls, obj:
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
70
87
|
"""Create an instance of PeliasGeoJSONPropertiesAddendumOsm from a dict"""
|
71
88
|
if obj is None:
|
72
89
|
return None
|
73
90
|
|
74
91
|
if not isinstance(obj, dict):
|
75
|
-
return
|
92
|
+
return cls.model_validate(obj)
|
76
93
|
|
77
|
-
_obj =
|
94
|
+
_obj = cls.model_validate({
|
78
95
|
"website": obj.get("website"),
|
79
96
|
"wikipedia": obj.get("wikipedia"),
|
80
97
|
"wikidata": obj.get("wikidata"),
|
@@ -87,3 +104,4 @@ class PeliasGeoJSONPropertiesAddendumOsm(BaseModel):
|
|
87
104
|
|
88
105
|
return _obj
|
89
106
|
|
107
|
+
|
@@ -3,23 +3,20 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
|
+
from __future__ import annotations
|
16
17
|
import json
|
17
|
-
import
|
18
|
-
|
19
|
-
from aenum import Enum, no_arg
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
from enum import Enum
|
19
|
+
from typing_extensions import Self
|
23
20
|
|
24
21
|
|
25
22
|
class PeliasLayer(str, Enum):
|
@@ -53,8 +50,8 @@ class PeliasLayer(str, Enum):
|
|
53
50
|
OCEAN = 'ocean'
|
54
51
|
|
55
52
|
@classmethod
|
56
|
-
def from_json(cls, json_str: str) ->
|
53
|
+
def from_json(cls, json_str: str) -> Self:
|
57
54
|
"""Create an instance of PeliasLayer from a JSON string"""
|
58
|
-
return
|
55
|
+
return cls(json.loads(json_str))
|
59
56
|
|
60
57
|
|
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,47 +18,65 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import List, Optional, Union
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from stadiamaps.models.geocoding_object import GeocodingObject
|
24
25
|
from stadiamaps.models.pelias_geo_json_feature import PeliasGeoJSONFeature
|
25
|
-
from
|
26
|
+
from typing import Optional, Set
|
27
|
+
from typing_extensions import Self
|
26
28
|
|
27
29
|
class PeliasResponse(BaseModel):
|
28
30
|
"""
|
29
31
|
PeliasResponse
|
30
|
-
"""
|
31
|
-
geocoding:
|
32
|
-
bbox: Optional[
|
33
|
-
features:
|
32
|
+
""" # noqa: E501
|
33
|
+
geocoding: GeocodingObject
|
34
|
+
bbox: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=4, max_length=4)]] = Field(default=None, description="An array of 4 floating point numbers representing the (W, S, E, N) extremes of the features found.")
|
35
|
+
features: List[PeliasGeoJSONFeature]
|
34
36
|
additional_properties: Dict[str, Any] = {}
|
35
|
-
__properties = ["geocoding", "bbox", "features"]
|
37
|
+
__properties: ClassVar[List[str]] = ["geocoding", "bbox", "features"]
|
38
|
+
|
39
|
+
model_config = ConfigDict(
|
40
|
+
populate_by_name=True,
|
41
|
+
validate_assignment=True,
|
42
|
+
protected_namespaces=(),
|
43
|
+
)
|
36
44
|
|
37
|
-
class Config:
|
38
|
-
"""Pydantic configuration"""
|
39
|
-
allow_population_by_field_name = True
|
40
|
-
validate_assignment = True
|
41
45
|
|
42
46
|
def to_str(self) -> str:
|
43
47
|
"""Returns the string representation of the model using alias"""
|
44
|
-
return pprint.pformat(self.
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
49
|
|
46
50
|
def to_json(self) -> str:
|
47
51
|
"""Returns the JSON representation of the model using alias"""
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
53
|
return json.dumps(self.to_dict())
|
49
54
|
|
50
55
|
@classmethod
|
51
|
-
def from_json(cls, json_str: str) ->
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
57
|
"""Create an instance of PeliasResponse from a JSON string"""
|
53
58
|
return cls.from_dict(json.loads(json_str))
|
54
59
|
|
55
|
-
def to_dict(self):
|
56
|
-
"""
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
62
|
+
|
63
|
+
This has the following differences from calling pydantic's
|
64
|
+
`self.model_dump(by_alias=True)`:
|
65
|
+
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
67
|
+
were set at model initialization. Other fields with value `None`
|
68
|
+
are ignored.
|
69
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
70
|
+
"""
|
71
|
+
excluded_fields: Set[str] = set([
|
72
|
+
"additional_properties",
|
73
|
+
])
|
74
|
+
|
75
|
+
_dict = self.model_dump(
|
76
|
+
by_alias=True,
|
77
|
+
exclude=excluded_fields,
|
78
|
+
exclude_none=True,
|
79
|
+
)
|
62
80
|
# override the default output from pydantic by calling `to_dict()` of geocoding
|
63
81
|
if self.geocoding:
|
64
82
|
_dict['geocoding'] = self.geocoding.to_dict()
|
@@ -77,18 +95,18 @@ class PeliasResponse(BaseModel):
|
|
77
95
|
return _dict
|
78
96
|
|
79
97
|
@classmethod
|
80
|
-
def from_dict(cls, obj:
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
99
|
"""Create an instance of PeliasResponse from a dict"""
|
82
100
|
if obj is None:
|
83
101
|
return None
|
84
102
|
|
85
103
|
if not isinstance(obj, dict):
|
86
|
-
return
|
104
|
+
return cls.model_validate(obj)
|
87
105
|
|
88
|
-
_obj =
|
89
|
-
"geocoding":
|
106
|
+
_obj = cls.model_validate({
|
107
|
+
"geocoding": GeocodingObject.from_dict(obj["geocoding"]) if obj.get("geocoding") is not None else None,
|
90
108
|
"bbox": obj.get("bbox"),
|
91
|
-
"features": [PeliasGeoJSONFeature.from_dict(_item) for _item in obj
|
109
|
+
"features": [PeliasGeoJSONFeature.from_dict(_item) for _item in obj["features"]] if obj.get("features") is not None else None
|
92
110
|
})
|
93
111
|
# store additional fields in additional_properties
|
94
112
|
for _key in obj.keys():
|
@@ -97,3 +115,4 @@ class PeliasResponse(BaseModel):
|
|
97
115
|
|
98
116
|
return _obj
|
99
117
|
|
118
|
+
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications. # noqa: E501
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 5.0.
|
8
|
+
The version of the OpenAPI document: 5.0.6
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -3,23 +3,20 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
|
+
from __future__ import annotations
|
16
17
|
import json
|
17
|
-
import
|
18
|
-
|
19
|
-
from aenum import Enum, no_arg
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
from enum import Enum
|
19
|
+
from typing_extensions import Self
|
23
20
|
|
24
21
|
|
25
22
|
class PeliasSource(str, Enum):
|
@@ -36,8 +33,8 @@ class PeliasSource(str, Enum):
|
|
36
33
|
GEONAMES = 'geonames'
|
37
34
|
|
38
35
|
@classmethod
|
39
|
-
def from_json(cls, json_str: str) ->
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
40
37
|
"""Create an instance of PeliasSource from a JSON string"""
|
41
|
-
return
|
38
|
+
return cls(json.loads(json_str))
|
42
39
|
|
43
40
|
|
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,20 +18,21 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
24
25
|
|
25
26
|
class Restrictions(BaseModel):
|
26
27
|
"""
|
27
28
|
Restrictions
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
29
30
|
golf_cart: Optional[StrictBool] = None
|
30
31
|
truck: Optional[StrictBool] = None
|
31
32
|
pedestrian: Optional[StrictBool] = None
|
32
33
|
wheelchair: Optional[StrictBool] = None
|
33
34
|
taxi: Optional[StrictBool] = None
|
34
|
-
hov: Optional[StrictBool] = Field(None, alias="HOV")
|
35
|
+
hov: Optional[StrictBool] = Field(default=None, alias="HOV")
|
35
36
|
emergency: Optional[StrictBool] = None
|
36
37
|
motorcycle: Optional[StrictBool] = None
|
37
38
|
car: Optional[StrictBool] = None
|
@@ -39,33 +40,49 @@ class Restrictions(BaseModel):
|
|
39
40
|
bus: Optional[StrictBool] = None
|
40
41
|
bicycle: Optional[StrictBool] = None
|
41
42
|
additional_properties: Dict[str, Any] = {}
|
42
|
-
__properties = ["golf_cart", "truck", "pedestrian", "wheelchair", "taxi", "HOV", "emergency", "motorcycle", "car", "moped", "bus", "bicycle"]
|
43
|
+
__properties: ClassVar[List[str]] = ["golf_cart", "truck", "pedestrian", "wheelchair", "taxi", "HOV", "emergency", "motorcycle", "car", "moped", "bus", "bicycle"]
|
44
|
+
|
45
|
+
model_config = ConfigDict(
|
46
|
+
populate_by_name=True,
|
47
|
+
validate_assignment=True,
|
48
|
+
protected_namespaces=(),
|
49
|
+
)
|
43
50
|
|
44
|
-
class Config:
|
45
|
-
"""Pydantic configuration"""
|
46
|
-
allow_population_by_field_name = True
|
47
|
-
validate_assignment = True
|
48
51
|
|
49
52
|
def to_str(self) -> str:
|
50
53
|
"""Returns the string representation of the model using alias"""
|
51
|
-
return pprint.pformat(self.
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
52
55
|
|
53
56
|
def to_json(self) -> str:
|
54
57
|
"""Returns the JSON representation of the model using alias"""
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
55
59
|
return json.dumps(self.to_dict())
|
56
60
|
|
57
61
|
@classmethod
|
58
|
-
def from_json(cls, json_str: str) ->
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
59
63
|
"""Create an instance of Restrictions from a JSON string"""
|
60
64
|
return cls.from_dict(json.loads(json_str))
|
61
65
|
|
62
|
-
def to_dict(self):
|
63
|
-
"""
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
68
|
+
|
69
|
+
This has the following differences from calling pydantic's
|
70
|
+
`self.model_dump(by_alias=True)`:
|
71
|
+
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
73
|
+
were set at model initialization. Other fields with value `None`
|
74
|
+
are ignored.
|
75
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
76
|
+
"""
|
77
|
+
excluded_fields: Set[str] = set([
|
78
|
+
"additional_properties",
|
79
|
+
])
|
80
|
+
|
81
|
+
_dict = self.model_dump(
|
82
|
+
by_alias=True,
|
83
|
+
exclude=excluded_fields,
|
84
|
+
exclude_none=True,
|
85
|
+
)
|
69
86
|
# puts key-value pairs in additional_properties in the top level
|
70
87
|
if self.additional_properties is not None:
|
71
88
|
for _key, _value in self.additional_properties.items():
|
@@ -74,21 +91,21 @@ class Restrictions(BaseModel):
|
|
74
91
|
return _dict
|
75
92
|
|
76
93
|
@classmethod
|
77
|
-
def from_dict(cls, obj:
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
78
95
|
"""Create an instance of Restrictions from a dict"""
|
79
96
|
if obj is None:
|
80
97
|
return None
|
81
98
|
|
82
99
|
if not isinstance(obj, dict):
|
83
|
-
return
|
100
|
+
return cls.model_validate(obj)
|
84
101
|
|
85
|
-
_obj =
|
102
|
+
_obj = cls.model_validate({
|
86
103
|
"golf_cart": obj.get("golf_cart"),
|
87
104
|
"truck": obj.get("truck"),
|
88
105
|
"pedestrian": obj.get("pedestrian"),
|
89
106
|
"wheelchair": obj.get("wheelchair"),
|
90
107
|
"taxi": obj.get("taxi"),
|
91
|
-
"
|
108
|
+
"HOV": obj.get("HOV"),
|
92
109
|
"emergency": obj.get("emergency"),
|
93
110
|
"motorcycle": obj.get("motorcycle"),
|
94
111
|
"car": obj.get("car"),
|
@@ -103,3 +120,4 @@ class Restrictions(BaseModel):
|
|
103
120
|
|
104
121
|
return _obj
|
105
122
|
|
123
|
+
|
stadiamaps/models/road_class.py
CHANGED
@@ -3,23 +3,20 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
|
+
from __future__ import annotations
|
16
17
|
import json
|
17
|
-
import
|
18
|
-
|
19
|
-
from aenum import Enum, no_arg
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
from enum import Enum
|
19
|
+
from typing_extensions import Self
|
23
20
|
|
24
21
|
|
25
22
|
class RoadClass(str, Enum):
|
@@ -40,8 +37,8 @@ class RoadClass(str, Enum):
|
|
40
37
|
SERVICE_OTHER = 'service_other'
|
41
38
|
|
42
39
|
@classmethod
|
43
|
-
def from_json(cls, json_str: str) ->
|
40
|
+
def from_json(cls, json_str: str) -> Self:
|
44
41
|
"""Create an instance of RoadClass from a JSON string"""
|
45
|
-
return
|
42
|
+
return cls(json.loads(json_str))
|
46
43
|
|
47
44
|
|
stadiamaps/models/route_leg.py
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,47 +18,65 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import List
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing_extensions import Annotated
|
24
24
|
from stadiamaps.models.route_maneuver import RouteManeuver
|
25
25
|
from stadiamaps.models.route_summary import RouteSummary
|
26
|
+
from typing import Optional, Set
|
27
|
+
from typing_extensions import Self
|
26
28
|
|
27
29
|
class RouteLeg(BaseModel):
|
28
30
|
"""
|
29
31
|
RouteLeg
|
30
|
-
"""
|
31
|
-
maneuvers:
|
32
|
-
shape: StrictStr = Field(
|
33
|
-
summary: RouteSummary
|
32
|
+
""" # noqa: E501
|
33
|
+
maneuvers: Annotated[List[RouteManeuver], Field(min_length=1)]
|
34
|
+
shape: StrictStr = Field(description="An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) with 6 digits of decimal precision.")
|
35
|
+
summary: RouteSummary
|
34
36
|
additional_properties: Dict[str, Any] = {}
|
35
|
-
__properties = ["maneuvers", "shape", "summary"]
|
37
|
+
__properties: ClassVar[List[str]] = ["maneuvers", "shape", "summary"]
|
38
|
+
|
39
|
+
model_config = ConfigDict(
|
40
|
+
populate_by_name=True,
|
41
|
+
validate_assignment=True,
|
42
|
+
protected_namespaces=(),
|
43
|
+
)
|
36
44
|
|
37
|
-
class Config:
|
38
|
-
"""Pydantic configuration"""
|
39
|
-
allow_population_by_field_name = True
|
40
|
-
validate_assignment = True
|
41
45
|
|
42
46
|
def to_str(self) -> str:
|
43
47
|
"""Returns the string representation of the model using alias"""
|
44
|
-
return pprint.pformat(self.
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
49
|
|
46
50
|
def to_json(self) -> str:
|
47
51
|
"""Returns the JSON representation of the model using alias"""
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
53
|
return json.dumps(self.to_dict())
|
49
54
|
|
50
55
|
@classmethod
|
51
|
-
def from_json(cls, json_str: str) ->
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
57
|
"""Create an instance of RouteLeg from a JSON string"""
|
53
58
|
return cls.from_dict(json.loads(json_str))
|
54
59
|
|
55
|
-
def to_dict(self):
|
56
|
-
"""
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
62
|
+
|
63
|
+
This has the following differences from calling pydantic's
|
64
|
+
`self.model_dump(by_alias=True)`:
|
65
|
+
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
67
|
+
were set at model initialization. Other fields with value `None`
|
68
|
+
are ignored.
|
69
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
70
|
+
"""
|
71
|
+
excluded_fields: Set[str] = set([
|
72
|
+
"additional_properties",
|
73
|
+
])
|
74
|
+
|
75
|
+
_dict = self.model_dump(
|
76
|
+
by_alias=True,
|
77
|
+
exclude=excluded_fields,
|
78
|
+
exclude_none=True,
|
79
|
+
)
|
62
80
|
# override the default output from pydantic by calling `to_dict()` of each item in maneuvers (list)
|
63
81
|
_items = []
|
64
82
|
if self.maneuvers:
|
@@ -77,18 +95,18 @@ class RouteLeg(BaseModel):
|
|
77
95
|
return _dict
|
78
96
|
|
79
97
|
@classmethod
|
80
|
-
def from_dict(cls, obj:
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
99
|
"""Create an instance of RouteLeg from a dict"""
|
82
100
|
if obj is None:
|
83
101
|
return None
|
84
102
|
|
85
103
|
if not isinstance(obj, dict):
|
86
|
-
return
|
104
|
+
return cls.model_validate(obj)
|
87
105
|
|
88
|
-
_obj =
|
89
|
-
"maneuvers": [RouteManeuver.from_dict(_item) for _item in obj
|
106
|
+
_obj = cls.model_validate({
|
107
|
+
"maneuvers": [RouteManeuver.from_dict(_item) for _item in obj["maneuvers"]] if obj.get("maneuvers") is not None else None,
|
90
108
|
"shape": obj.get("shape"),
|
91
|
-
"summary": RouteSummary.from_dict(obj
|
109
|
+
"summary": RouteSummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None
|
92
110
|
})
|
93
111
|
# store additional fields in additional_properties
|
94
112
|
for _key in obj.keys():
|
@@ -97,3 +115,4 @@ class RouteLeg(BaseModel):
|
|
97
115
|
|
98
116
|
return _obj
|
99
117
|
|
118
|
+
|