stadiamaps 1.0.7__py3-none-any.whl → 2.1.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 +75 -48
- stadiamaps/models/base_costing_options.py +59 -34
- stadiamaps/models/base_trace_request.py +70 -40
- stadiamaps/models/bicycle_costing_options.py +67 -42
- 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 +1 -1
- stadiamaps/models/geo_json_point.py +47 -28
- stadiamaps/models/geo_json_point_all_of.py +1 -1
- stadiamaps/models/geo_json_polygon.py +47 -28
- stadiamaps/models/geo_json_polygon_all_of.py +1 -1
- 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_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_route_response.py +57 -29
- stadiamaps/models/map_match_trace_options.py +47 -29
- stadiamaps/models/map_match_waypoint.py +49 -30
- 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 +76 -49
- stadiamaps/models/motorcycle_costing_options.py +75 -48
- 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_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_summary.py +48 -30
- stadiamaps/models/route_trip.py +135 -0
- stadiamaps/models/routing_response_waypoint.py +49 -30
- stadiamaps/models/routing_waypoint.py +60 -41
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
- stadiamaps/models/simple_routing_waypoint.py +48 -29
- 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_filters.py +1 -1
- stadiamaps/models/trace_attributes_response.py +54 -35
- 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 +78 -51
- 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.7.dist-info → stadiamaps-2.1.0.dist-info}/METADATA +4 -4
- stadiamaps-2.1.0.dist-info/RECORD +128 -0
- {stadiamaps-1.0.7.dist-info → stadiamaps-2.1.0.dist-info}/WHEEL +1 -1
- stadiamaps-1.0.7.dist-info/RECORD +0 -125
- {stadiamaps-1.0.7.dist-info → stadiamaps-2.1.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-1.0.7.dist-info → stadiamaps-2.1.0.dist-info}/top_level.txt +0 -0
stadiamaps/models/coordinate.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.1.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,44 +18,62 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Union
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
22
|
+
from typing import Any, ClassVar, Dict, List, Union
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
24
26
|
|
25
27
|
class Coordinate(BaseModel):
|
26
28
|
"""
|
27
29
|
Coordinate
|
28
|
-
"""
|
29
|
-
lat: Union[
|
30
|
-
lon: Union[
|
30
|
+
""" # noqa: E501
|
31
|
+
lat: Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]] = Field(description="The latitude of a point in the shape.")
|
32
|
+
lon: Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]] = Field(description="The longitude of a point in the shape.")
|
31
33
|
additional_properties: Dict[str, Any] = {}
|
32
|
-
__properties = ["lat", "lon"]
|
34
|
+
__properties: ClassVar[List[str]] = ["lat", "lon"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
33
41
|
|
34
|
-
class Config:
|
35
|
-
"""Pydantic configuration"""
|
36
|
-
allow_population_by_field_name = True
|
37
|
-
validate_assignment = True
|
38
42
|
|
39
43
|
def to_str(self) -> str:
|
40
44
|
"""Returns the string representation of the model using alias"""
|
41
|
-
return pprint.pformat(self.
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
42
46
|
|
43
47
|
def to_json(self) -> str:
|
44
48
|
"""Returns the JSON representation of the model using alias"""
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
45
50
|
return json.dumps(self.to_dict())
|
46
51
|
|
47
52
|
@classmethod
|
48
|
-
def from_json(cls, json_str: str) ->
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
49
54
|
"""Create an instance of Coordinate from a JSON string"""
|
50
55
|
return cls.from_dict(json.loads(json_str))
|
51
56
|
|
52
|
-
def to_dict(self):
|
53
|
-
"""
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
59
|
+
|
60
|
+
This has the following differences from calling pydantic's
|
61
|
+
`self.model_dump(by_alias=True)`:
|
62
|
+
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
64
|
+
were set at model initialization. Other fields with value `None`
|
65
|
+
are ignored.
|
66
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
"additional_properties",
|
70
|
+
])
|
71
|
+
|
72
|
+
_dict = self.model_dump(
|
73
|
+
by_alias=True,
|
74
|
+
exclude=excluded_fields,
|
75
|
+
exclude_none=True,
|
76
|
+
)
|
59
77
|
# puts key-value pairs in additional_properties in the top level
|
60
78
|
if self.additional_properties is not None:
|
61
79
|
for _key, _value in self.additional_properties.items():
|
@@ -64,15 +82,15 @@ class Coordinate(BaseModel):
|
|
64
82
|
return _dict
|
65
83
|
|
66
84
|
@classmethod
|
67
|
-
def from_dict(cls, obj:
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
68
86
|
"""Create an instance of Coordinate from a dict"""
|
69
87
|
if obj is None:
|
70
88
|
return None
|
71
89
|
|
72
90
|
if not isinstance(obj, dict):
|
73
|
-
return
|
91
|
+
return cls.model_validate(obj)
|
74
92
|
|
75
|
-
_obj =
|
93
|
+
_obj = cls.model_validate({
|
76
94
|
"lat": obj.get("lat"),
|
77
95
|
"lon": obj.get("lon")
|
78
96
|
})
|
@@ -83,3 +101,4 @@ class Coordinate(BaseModel):
|
|
83
101
|
|
84
102
|
return _obj
|
85
103
|
|
104
|
+
|
@@ -3,28 +3,25 @@
|
|
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.1.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 CostingModel(str, Enum):
|
26
23
|
"""
|
27
|
-
Costing models for determining the most optimal route to take. Note that bikeshare and motorcycle are still in beta. While Valhalla supports multimodal routing, we do not currently process transit data and have excluded it from the list. See https://valhalla.
|
24
|
+
Costing models for determining the most optimal route to take. Note that bikeshare and motorcycle are still in beta. While Valhalla supports multimodal routing, we do not currently process transit data and have excluded it from the list. See https://valhalla.github.io/valhalla/api/turn-by-turn/api-reference/#costing-models for detailed descriptions of each model.
|
28
25
|
"""
|
29
26
|
|
30
27
|
"""
|
@@ -39,10 +36,11 @@ class CostingModel(str, Enum):
|
|
39
36
|
MOTOR_SCOOTER = 'motor_scooter'
|
40
37
|
MOTORCYCLE = 'motorcycle'
|
41
38
|
PEDESTRIAN = 'pedestrian'
|
39
|
+
LOW_SPEED_VEHICLE = 'low_speed_vehicle'
|
42
40
|
|
43
41
|
@classmethod
|
44
|
-
def from_json(cls, json_str: str) ->
|
42
|
+
def from_json(cls, json_str: str) -> Self:
|
45
43
|
"""Create an instance of CostingModel from a JSON string"""
|
46
|
-
return
|
44
|
+
return cls(json.loads(json_str))
|
47
45
|
|
48
46
|
|
@@ -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.1.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 pydantic import BaseModel
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
24
23
|
from stadiamaps.models.auto_costing_options import AutoCostingOptions
|
25
24
|
from stadiamaps.models.bicycle_costing_options import BicycleCostingOptions
|
26
25
|
from stadiamaps.models.motor_scooter_costing_options import MotorScooterCostingOptions
|
27
26
|
from stadiamaps.models.motorcycle_costing_options import MotorcycleCostingOptions
|
28
27
|
from stadiamaps.models.pedestrian_costing_options import PedestrianCostingOptions
|
29
28
|
from stadiamaps.models.truck_costing_options import TruckCostingOptions
|
29
|
+
from typing import Optional, Set
|
30
|
+
from typing_extensions import Self
|
30
31
|
|
31
32
|
class CostingOptions(BaseModel):
|
32
33
|
"""
|
33
34
|
CostingOptions
|
34
|
-
"""
|
35
|
+
""" # noqa: E501
|
35
36
|
auto: Optional[AutoCostingOptions] = None
|
36
37
|
bus: Optional[AutoCostingOptions] = None
|
37
38
|
taxi: Optional[AutoCostingOptions] = None
|
@@ -41,33 +42,49 @@ class CostingOptions(BaseModel):
|
|
41
42
|
motorcycle: Optional[MotorcycleCostingOptions] = None
|
42
43
|
pedestrian: Optional[PedestrianCostingOptions] = None
|
43
44
|
additional_properties: Dict[str, Any] = {}
|
44
|
-
__properties = ["auto", "bus", "taxi", "truck", "bicycle", "motor_scooter", "motorcycle", "pedestrian"]
|
45
|
+
__properties: ClassVar[List[str]] = ["auto", "bus", "taxi", "truck", "bicycle", "motor_scooter", "motorcycle", "pedestrian"]
|
46
|
+
|
47
|
+
model_config = ConfigDict(
|
48
|
+
populate_by_name=True,
|
49
|
+
validate_assignment=True,
|
50
|
+
protected_namespaces=(),
|
51
|
+
)
|
45
52
|
|
46
|
-
class Config:
|
47
|
-
"""Pydantic configuration"""
|
48
|
-
allow_population_by_field_name = True
|
49
|
-
validate_assignment = True
|
50
53
|
|
51
54
|
def to_str(self) -> str:
|
52
55
|
"""Returns the string representation of the model using alias"""
|
53
|
-
return pprint.pformat(self.
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
54
57
|
|
55
58
|
def to_json(self) -> str:
|
56
59
|
"""Returns the JSON representation of the model using alias"""
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
57
61
|
return json.dumps(self.to_dict())
|
58
62
|
|
59
63
|
@classmethod
|
60
|
-
def from_json(cls, json_str: str) ->
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
61
65
|
"""Create an instance of CostingOptions from a JSON string"""
|
62
66
|
return cls.from_dict(json.loads(json_str))
|
63
67
|
|
64
|
-
def to_dict(self):
|
65
|
-
"""
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
70
|
+
|
71
|
+
This has the following differences from calling pydantic's
|
72
|
+
`self.model_dump(by_alias=True)`:
|
73
|
+
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
75
|
+
were set at model initialization. Other fields with value `None`
|
76
|
+
are ignored.
|
77
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
78
|
+
"""
|
79
|
+
excluded_fields: Set[str] = set([
|
80
|
+
"additional_properties",
|
81
|
+
])
|
82
|
+
|
83
|
+
_dict = self.model_dump(
|
84
|
+
by_alias=True,
|
85
|
+
exclude=excluded_fields,
|
86
|
+
exclude_none=True,
|
87
|
+
)
|
71
88
|
# override the default output from pydantic by calling `to_dict()` of auto
|
72
89
|
if self.auto:
|
73
90
|
_dict['auto'] = self.auto.to_dict()
|
@@ -100,23 +117,23 @@ class CostingOptions(BaseModel):
|
|
100
117
|
return _dict
|
101
118
|
|
102
119
|
@classmethod
|
103
|
-
def from_dict(cls, obj:
|
120
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
104
121
|
"""Create an instance of CostingOptions from a dict"""
|
105
122
|
if obj is None:
|
106
123
|
return None
|
107
124
|
|
108
125
|
if not isinstance(obj, dict):
|
109
|
-
return
|
110
|
-
|
111
|
-
_obj =
|
112
|
-
"auto": AutoCostingOptions.from_dict(obj
|
113
|
-
"bus": AutoCostingOptions.from_dict(obj
|
114
|
-
"taxi": AutoCostingOptions.from_dict(obj
|
115
|
-
"truck": TruckCostingOptions.from_dict(obj
|
116
|
-
"bicycle": BicycleCostingOptions.from_dict(obj
|
117
|
-
"motor_scooter": MotorScooterCostingOptions.from_dict(obj
|
118
|
-
"motorcycle": MotorcycleCostingOptions.from_dict(obj
|
119
|
-
"pedestrian": PedestrianCostingOptions.from_dict(obj
|
126
|
+
return cls.model_validate(obj)
|
127
|
+
|
128
|
+
_obj = cls.model_validate({
|
129
|
+
"auto": AutoCostingOptions.from_dict(obj["auto"]) if obj.get("auto") is not None else None,
|
130
|
+
"bus": AutoCostingOptions.from_dict(obj["bus"]) if obj.get("bus") is not None else None,
|
131
|
+
"taxi": AutoCostingOptions.from_dict(obj["taxi"]) if obj.get("taxi") is not None else None,
|
132
|
+
"truck": TruckCostingOptions.from_dict(obj["truck"]) if obj.get("truck") is not None else None,
|
133
|
+
"bicycle": BicycleCostingOptions.from_dict(obj["bicycle"]) if obj.get("bicycle") is not None else None,
|
134
|
+
"motor_scooter": MotorScooterCostingOptions.from_dict(obj["motor_scooter"]) if obj.get("motor_scooter") is not None else None,
|
135
|
+
"motorcycle": MotorcycleCostingOptions.from_dict(obj["motorcycle"]) if obj.get("motorcycle") is not None else None,
|
136
|
+
"pedestrian": PedestrianCostingOptions.from_dict(obj["pedestrian"]) if obj.get("pedestrian") is not None else None
|
120
137
|
})
|
121
138
|
# store additional fields in additional_properties
|
122
139
|
for _key in obj.keys():
|
@@ -125,3 +142,4 @@ class CostingOptions(BaseModel):
|
|
125
142
|
|
126
143
|
return _obj
|
127
144
|
|
145
|
+
|
@@ -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.1.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,57 +18,74 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional
|
23
|
-
from pydantic import BaseModel, Field, StrictStr, validator
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
24
23
|
from stadiamaps.models.distance_unit import DistanceUnit
|
25
24
|
from stadiamaps.models.valhalla_languages import ValhallaLanguages
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
26
27
|
|
27
28
|
class DirectionsOptions(BaseModel):
|
28
29
|
"""
|
29
30
|
DirectionsOptions
|
30
|
-
"""
|
31
|
+
""" # noqa: E501
|
31
32
|
units: Optional[DistanceUnit] = None
|
32
33
|
language: Optional[ValhallaLanguages] = None
|
33
|
-
directions_type: Optional[StrictStr] = Field('instructions', description="The level of directional narrative to include. Locations and times will always be returned, but narrative generation verbosity can be controlled with this parameter.")
|
34
|
+
directions_type: Optional[StrictStr] = Field(default='instructions', description="The level of directional narrative to include. Locations and times will always be returned, but narrative generation verbosity can be controlled with this parameter.")
|
34
35
|
additional_properties: Dict[str, Any] = {}
|
35
|
-
__properties = ["units", "language", "directions_type"]
|
36
|
+
__properties: ClassVar[List[str]] = ["units", "language", "directions_type"]
|
36
37
|
|
37
|
-
@
|
38
|
+
@field_validator('directions_type')
|
38
39
|
def directions_type_validate_enum(cls, value):
|
39
40
|
"""Validates the enum"""
|
40
41
|
if value is None:
|
41
42
|
return value
|
42
43
|
|
43
|
-
if value not in ('none', 'maneuvers', 'instructions'):
|
44
|
+
if value not in set(['none', 'maneuvers', 'instructions']):
|
44
45
|
raise ValueError("must be one of enum values ('none', 'maneuvers', 'instructions')")
|
45
46
|
return value
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
model_config = ConfigDict(
|
49
|
+
populate_by_name=True,
|
50
|
+
validate_assignment=True,
|
51
|
+
protected_namespaces=(),
|
52
|
+
)
|
53
|
+
|
51
54
|
|
52
55
|
def to_str(self) -> str:
|
53
56
|
"""Returns the string representation of the model using alias"""
|
54
|
-
return pprint.pformat(self.
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
55
58
|
|
56
59
|
def to_json(self) -> str:
|
57
60
|
"""Returns the JSON representation of the model using alias"""
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
58
62
|
return json.dumps(self.to_dict())
|
59
63
|
|
60
64
|
@classmethod
|
61
|
-
def from_json(cls, json_str: str) ->
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
62
66
|
"""Create an instance of DirectionsOptions from a JSON string"""
|
63
67
|
return cls.from_dict(json.loads(json_str))
|
64
68
|
|
65
|
-
def to_dict(self):
|
66
|
-
"""
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
71
|
+
|
72
|
+
This has the following differences from calling pydantic's
|
73
|
+
`self.model_dump(by_alias=True)`:
|
74
|
+
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
76
|
+
were set at model initialization. Other fields with value `None`
|
77
|
+
are ignored.
|
78
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
79
|
+
"""
|
80
|
+
excluded_fields: Set[str] = set([
|
81
|
+
"additional_properties",
|
82
|
+
])
|
83
|
+
|
84
|
+
_dict = self.model_dump(
|
85
|
+
by_alias=True,
|
86
|
+
exclude=excluded_fields,
|
87
|
+
exclude_none=True,
|
88
|
+
)
|
72
89
|
# puts key-value pairs in additional_properties in the top level
|
73
90
|
if self.additional_properties is not None:
|
74
91
|
for _key, _value in self.additional_properties.items():
|
@@ -77,15 +94,15 @@ class DirectionsOptions(BaseModel):
|
|
77
94
|
return _dict
|
78
95
|
|
79
96
|
@classmethod
|
80
|
-
def from_dict(cls, obj:
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
98
|
"""Create an instance of DirectionsOptions from a dict"""
|
82
99
|
if obj is None:
|
83
100
|
return None
|
84
101
|
|
85
102
|
if not isinstance(obj, dict):
|
86
|
-
return
|
103
|
+
return cls.model_validate(obj)
|
87
104
|
|
88
|
-
_obj =
|
105
|
+
_obj = cls.model_validate({
|
89
106
|
"units": obj.get("units"),
|
90
107
|
"language": obj.get("language"),
|
91
108
|
"directions_type": obj.get("directions_type") if obj.get("directions_type") is not None else 'instructions'
|
@@ -97,3 +114,4 @@ class DirectionsOptions(BaseModel):
|
|
97
114
|
|
98
115
|
return _obj
|
99
116
|
|
117
|
+
|
@@ -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.1.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 DistanceUnit(str, Enum):
|
@@ -34,8 +31,8 @@ class DistanceUnit(str, Enum):
|
|
34
31
|
MI = 'mi'
|
35
32
|
|
36
33
|
@classmethod
|
37
|
-
def from_json(cls, json_str: str) ->
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
38
35
|
"""Create an instance of DistanceUnit from a JSON string"""
|
39
|
-
return
|
36
|
+
return cls(json.loads(json_str))
|
40
37
|
|
41
38
|
|
stadiamaps/models/edge_sign.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.1.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 List, 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 EdgeSign(BaseModel):
|
26
27
|
"""
|
27
28
|
EdgeSign
|
28
|
-
"""
|
29
|
-
exit_number: Optional[
|
30
|
-
exit_branch: Optional[
|
31
|
-
exit_toward: Optional[
|
32
|
-
exit_name: Optional[
|
29
|
+
""" # noqa: E501
|
30
|
+
exit_number: Optional[List[StrictStr]] = None
|
31
|
+
exit_branch: Optional[List[StrictStr]] = None
|
32
|
+
exit_toward: Optional[List[StrictStr]] = None
|
33
|
+
exit_name: Optional[List[StrictStr]] = None
|
33
34
|
additional_properties: Dict[str, Any] = {}
|
34
|
-
__properties = ["exit_number", "exit_branch", "exit_toward", "exit_name"]
|
35
|
+
__properties: ClassVar[List[str]] = ["exit_number", "exit_branch", "exit_toward", "exit_name"]
|
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 EdgeSign 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 EdgeSign(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 EdgeSign 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
|
"exit_number": obj.get("exit_number"),
|
79
96
|
"exit_branch": obj.get("exit_branch"),
|
80
97
|
"exit_toward": obj.get("exit_toward"),
|
@@ -87,3 +104,4 @@ class EdgeSign(BaseModel):
|
|
87
104
|
|
88
105
|
return _obj
|
89
106
|
|
107
|
+
|