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
stadiamaps/models/locate_node.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,20 +18,22 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional, Union
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing_extensions import Annotated
|
24
24
|
from stadiamaps.models.access import Access
|
25
25
|
from stadiamaps.models.administrative import Administrative
|
26
26
|
from stadiamaps.models.node_id import NodeId
|
27
27
|
from stadiamaps.models.node_type import NodeType
|
28
|
+
from typing import Optional, Set
|
29
|
+
from typing_extensions import Self
|
28
30
|
|
29
31
|
class LocateNode(BaseModel):
|
30
32
|
"""
|
31
33
|
LocateNode
|
32
|
-
"""
|
33
|
-
lat: Union[
|
34
|
-
lon: Union[
|
34
|
+
""" # noqa: E501
|
35
|
+
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.")
|
36
|
+
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.")
|
35
37
|
traffic_signal: Optional[StrictBool] = None
|
36
38
|
type: Optional[NodeType] = None
|
37
39
|
node_id: Optional[NodeId] = None
|
@@ -43,43 +45,59 @@ class LocateNode(BaseModel):
|
|
43
45
|
local_edge_count: Optional[StrictInt] = None
|
44
46
|
mode_change: Optional[StrictBool] = None
|
45
47
|
additional_properties: Dict[str, Any] = {}
|
46
|
-
__properties = ["lat", "lon", "traffic_signal", "type", "node_id", "access", "edge_count", "administrative", "intersection_type", "density", "local_edge_count", "mode_change"]
|
48
|
+
__properties: ClassVar[List[str]] = ["lat", "lon", "traffic_signal", "type", "node_id", "access", "edge_count", "administrative", "intersection_type", "density", "local_edge_count", "mode_change"]
|
47
49
|
|
48
|
-
@
|
50
|
+
@field_validator('intersection_type')
|
49
51
|
def intersection_type_validate_enum(cls, value):
|
50
52
|
"""Validates the enum"""
|
51
53
|
if value is None:
|
52
54
|
return value
|
53
55
|
|
54
|
-
if value not in ('regular', 'false', 'dead-end', 'fork'):
|
56
|
+
if value not in set(['regular', 'false', 'dead-end', 'fork']):
|
55
57
|
raise ValueError("must be one of enum values ('regular', 'false', 'dead-end', 'fork')")
|
56
58
|
return value
|
57
59
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
model_config = ConfigDict(
|
61
|
+
populate_by_name=True,
|
62
|
+
validate_assignment=True,
|
63
|
+
protected_namespaces=(),
|
64
|
+
)
|
65
|
+
|
62
66
|
|
63
67
|
def to_str(self) -> str:
|
64
68
|
"""Returns the string representation of the model using alias"""
|
65
|
-
return pprint.pformat(self.
|
69
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
66
70
|
|
67
71
|
def to_json(self) -> str:
|
68
72
|
"""Returns the JSON representation of the model using alias"""
|
73
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
69
74
|
return json.dumps(self.to_dict())
|
70
75
|
|
71
76
|
@classmethod
|
72
|
-
def from_json(cls, json_str: str) ->
|
77
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
73
78
|
"""Create an instance of LocateNode from a JSON string"""
|
74
79
|
return cls.from_dict(json.loads(json_str))
|
75
80
|
|
76
|
-
def to_dict(self):
|
77
|
-
"""
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
81
|
+
def to_dict(self) -> Dict[str, Any]:
|
82
|
+
"""Return the dictionary representation of the model using alias.
|
83
|
+
|
84
|
+
This has the following differences from calling pydantic's
|
85
|
+
`self.model_dump(by_alias=True)`:
|
86
|
+
|
87
|
+
* `None` is only added to the output dict for nullable fields that
|
88
|
+
were set at model initialization. Other fields with value `None`
|
89
|
+
are ignored.
|
90
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
91
|
+
"""
|
92
|
+
excluded_fields: Set[str] = set([
|
93
|
+
"additional_properties",
|
94
|
+
])
|
95
|
+
|
96
|
+
_dict = self.model_dump(
|
97
|
+
by_alias=True,
|
98
|
+
exclude=excluded_fields,
|
99
|
+
exclude_none=True,
|
100
|
+
)
|
83
101
|
# override the default output from pydantic by calling `to_dict()` of node_id
|
84
102
|
if self.node_id:
|
85
103
|
_dict['node_id'] = self.node_id.to_dict()
|
@@ -97,23 +115,23 @@ class LocateNode(BaseModel):
|
|
97
115
|
return _dict
|
98
116
|
|
99
117
|
@classmethod
|
100
|
-
def from_dict(cls, obj:
|
118
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
101
119
|
"""Create an instance of LocateNode from a dict"""
|
102
120
|
if obj is None:
|
103
121
|
return None
|
104
122
|
|
105
123
|
if not isinstance(obj, dict):
|
106
|
-
return
|
124
|
+
return cls.model_validate(obj)
|
107
125
|
|
108
|
-
_obj =
|
126
|
+
_obj = cls.model_validate({
|
109
127
|
"lat": obj.get("lat"),
|
110
128
|
"lon": obj.get("lon"),
|
111
129
|
"traffic_signal": obj.get("traffic_signal"),
|
112
130
|
"type": obj.get("type"),
|
113
|
-
"node_id": NodeId.from_dict(obj
|
114
|
-
"access": Access.from_dict(obj
|
131
|
+
"node_id": NodeId.from_dict(obj["node_id"]) if obj.get("node_id") is not None else None,
|
132
|
+
"access": Access.from_dict(obj["access"]) if obj.get("access") is not None else None,
|
115
133
|
"edge_count": obj.get("edge_count"),
|
116
|
-
"administrative": Administrative.from_dict(obj
|
134
|
+
"administrative": Administrative.from_dict(obj["administrative"]) if obj.get("administrative") is not None else None,
|
117
135
|
"intersection_type": obj.get("intersection_type"),
|
118
136
|
"density": obj.get("density"),
|
119
137
|
"local_edge_count": obj.get("local_edge_count"),
|
@@ -126,3 +144,4 @@ class LocateNode(BaseModel):
|
|
126
144
|
|
127
145
|
return _obj
|
128
146
|
|
147
|
+
|
@@ -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,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,49 +18,66 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import List, Optional, Union
|
23
|
-
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
24
23
|
from stadiamaps.models.locate_edge import LocateEdge
|
25
24
|
from stadiamaps.models.locate_node import LocateNode
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
26
27
|
|
27
28
|
class LocateObject(BaseModel):
|
28
29
|
"""
|
29
30
|
LocateObject
|
30
|
-
"""
|
31
|
-
id: Optional[StrictStr] = Field(None, description="An identifier to disambiguate requests (echoed by the server).")
|
32
|
-
input_lat: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The input (searched) latitude.")
|
33
|
-
input_lon: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The input (searched) longitude.")
|
34
|
-
nodes: Optional[
|
35
|
-
edges: Optional[
|
31
|
+
""" # noqa: E501
|
32
|
+
id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
|
33
|
+
input_lat: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The input (searched) latitude.")
|
34
|
+
input_lon: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The input (searched) longitude.")
|
35
|
+
nodes: Optional[List[LocateNode]] = None
|
36
|
+
edges: Optional[List[LocateEdge]] = None
|
36
37
|
additional_properties: Dict[str, Any] = {}
|
37
|
-
__properties = ["id", "input_lat", "input_lon", "nodes", "edges"]
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "input_lat", "input_lon", "nodes", "edges"]
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
populate_by_name=True,
|
42
|
+
validate_assignment=True,
|
43
|
+
protected_namespaces=(),
|
44
|
+
)
|
38
45
|
|
39
|
-
class Config:
|
40
|
-
"""Pydantic configuration"""
|
41
|
-
allow_population_by_field_name = True
|
42
|
-
validate_assignment = True
|
43
46
|
|
44
47
|
def to_str(self) -> str:
|
45
48
|
"""Returns the string representation of the model using alias"""
|
46
|
-
return pprint.pformat(self.
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
50
|
|
48
51
|
def to_json(self) -> str:
|
49
52
|
"""Returns the JSON representation of the model using alias"""
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
54
|
return json.dumps(self.to_dict())
|
51
55
|
|
52
56
|
@classmethod
|
53
|
-
def from_json(cls, json_str: str) ->
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
58
|
"""Create an instance of LocateObject from a JSON string"""
|
55
59
|
return cls.from_dict(json.loads(json_str))
|
56
60
|
|
57
|
-
def to_dict(self):
|
58
|
-
"""
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
63
|
+
|
64
|
+
This has the following differences from calling pydantic's
|
65
|
+
`self.model_dump(by_alias=True)`:
|
66
|
+
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
68
|
+
were set at model initialization. Other fields with value `None`
|
69
|
+
are ignored.
|
70
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
71
|
+
"""
|
72
|
+
excluded_fields: Set[str] = set([
|
73
|
+
"additional_properties",
|
74
|
+
])
|
75
|
+
|
76
|
+
_dict = self.model_dump(
|
77
|
+
by_alias=True,
|
78
|
+
exclude=excluded_fields,
|
79
|
+
exclude_none=True,
|
80
|
+
)
|
64
81
|
# override the default output from pydantic by calling `to_dict()` of each item in nodes (list)
|
65
82
|
_items = []
|
66
83
|
if self.nodes:
|
@@ -83,20 +100,20 @@ class LocateObject(BaseModel):
|
|
83
100
|
return _dict
|
84
101
|
|
85
102
|
@classmethod
|
86
|
-
def from_dict(cls, obj:
|
103
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
104
|
"""Create an instance of LocateObject from a dict"""
|
88
105
|
if obj is None:
|
89
106
|
return None
|
90
107
|
|
91
108
|
if not isinstance(obj, dict):
|
92
|
-
return
|
109
|
+
return cls.model_validate(obj)
|
93
110
|
|
94
|
-
_obj =
|
111
|
+
_obj = cls.model_validate({
|
95
112
|
"id": obj.get("id"),
|
96
113
|
"input_lat": obj.get("input_lat"),
|
97
114
|
"input_lon": obj.get("input_lon"),
|
98
|
-
"nodes": [LocateNode.from_dict(_item) for _item in obj
|
99
|
-
"edges": [LocateEdge.from_dict(_item) for _item in obj
|
115
|
+
"nodes": [LocateNode.from_dict(_item) for _item in obj["nodes"]] if obj.get("nodes") is not None else None,
|
116
|
+
"edges": [LocateEdge.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None
|
100
117
|
})
|
101
118
|
# store additional fields in additional_properties
|
102
119
|
for _key in obj.keys():
|
@@ -105,3 +122,4 @@ class LocateObject(BaseModel):
|
|
105
122
|
|
106
123
|
return _obj
|
107
124
|
|
125
|
+
|
@@ -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,64 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import List, Optional
|
23
|
-
from pydantic import BaseModel, Field, conlist
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
24
23
|
from stadiamaps.models.maneuver_sign_element import ManeuverSignElement
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
25
26
|
|
26
27
|
class ManeuverSign(BaseModel):
|
27
28
|
"""
|
28
29
|
ManeuverSign
|
29
|
-
"""
|
30
|
-
exit_number_elements: Optional[
|
31
|
-
exit_branch_elements: Optional[
|
32
|
-
exit_toward_elements: Optional[
|
33
|
-
exit_name_elements: Optional[
|
30
|
+
""" # noqa: E501
|
31
|
+
exit_number_elements: Optional[List[ManeuverSignElement]] = Field(default=None, description="A list of exit number elements. This is typically just a single value.")
|
32
|
+
exit_branch_elements: Optional[List[ManeuverSignElement]] = Field(default=None, description="A list of exit branch elements. The text is a subsequent road name or route number after the sign.")
|
33
|
+
exit_toward_elements: Optional[List[ManeuverSignElement]] = Field(default=None, description="A list of exit name elements. The text is the interchange identifier (used more frequently outside the US).")
|
34
|
+
exit_name_elements: Optional[List[ManeuverSignElement]] = Field(default=None, description="A list of exit name elements. The text is the location where the road ahead goes (typically a city, but occasionally a road name or route number).")
|
34
35
|
additional_properties: Dict[str, Any] = {}
|
35
|
-
__properties = ["exit_number_elements", "exit_branch_elements", "exit_toward_elements", "exit_name_elements"]
|
36
|
+
__properties: ClassVar[List[str]] = ["exit_number_elements", "exit_branch_elements", "exit_toward_elements", "exit_name_elements"]
|
37
|
+
|
38
|
+
model_config = ConfigDict(
|
39
|
+
populate_by_name=True,
|
40
|
+
validate_assignment=True,
|
41
|
+
protected_namespaces=(),
|
42
|
+
)
|
36
43
|
|
37
|
-
class Config:
|
38
|
-
"""Pydantic configuration"""
|
39
|
-
allow_population_by_field_name = True
|
40
|
-
validate_assignment = True
|
41
44
|
|
42
45
|
def to_str(self) -> str:
|
43
46
|
"""Returns the string representation of the model using alias"""
|
44
|
-
return pprint.pformat(self.
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
48
|
|
46
49
|
def to_json(self) -> str:
|
47
50
|
"""Returns the JSON representation of the model using alias"""
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
52
|
return json.dumps(self.to_dict())
|
49
53
|
|
50
54
|
@classmethod
|
51
|
-
def from_json(cls, json_str: str) ->
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
56
|
"""Create an instance of ManeuverSign from a JSON string"""
|
53
57
|
return cls.from_dict(json.loads(json_str))
|
54
58
|
|
55
|
-
def to_dict(self):
|
56
|
-
"""
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
61
|
+
|
62
|
+
This has the following differences from calling pydantic's
|
63
|
+
`self.model_dump(by_alias=True)`:
|
64
|
+
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
66
|
+
were set at model initialization. Other fields with value `None`
|
67
|
+
are ignored.
|
68
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
69
|
+
"""
|
70
|
+
excluded_fields: Set[str] = set([
|
71
|
+
"additional_properties",
|
72
|
+
])
|
73
|
+
|
74
|
+
_dict = self.model_dump(
|
75
|
+
by_alias=True,
|
76
|
+
exclude=excluded_fields,
|
77
|
+
exclude_none=True,
|
78
|
+
)
|
62
79
|
# override the default output from pydantic by calling `to_dict()` of each item in exit_number_elements (list)
|
63
80
|
_items = []
|
64
81
|
if self.exit_number_elements:
|
@@ -95,19 +112,19 @@ class ManeuverSign(BaseModel):
|
|
95
112
|
return _dict
|
96
113
|
|
97
114
|
@classmethod
|
98
|
-
def from_dict(cls, obj:
|
115
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
99
116
|
"""Create an instance of ManeuverSign from a dict"""
|
100
117
|
if obj is None:
|
101
118
|
return None
|
102
119
|
|
103
120
|
if not isinstance(obj, dict):
|
104
|
-
return
|
121
|
+
return cls.model_validate(obj)
|
105
122
|
|
106
|
-
_obj =
|
107
|
-
"exit_number_elements": [ManeuverSignElement.from_dict(_item) for _item in obj
|
108
|
-
"exit_branch_elements": [ManeuverSignElement.from_dict(_item) for _item in obj
|
109
|
-
"exit_toward_elements": [ManeuverSignElement.from_dict(_item) for _item in obj
|
110
|
-
"exit_name_elements": [ManeuverSignElement.from_dict(_item) for _item in obj
|
123
|
+
_obj = cls.model_validate({
|
124
|
+
"exit_number_elements": [ManeuverSignElement.from_dict(_item) for _item in obj["exit_number_elements"]] if obj.get("exit_number_elements") is not None else None,
|
125
|
+
"exit_branch_elements": [ManeuverSignElement.from_dict(_item) for _item in obj["exit_branch_elements"]] if obj.get("exit_branch_elements") is not None else None,
|
126
|
+
"exit_toward_elements": [ManeuverSignElement.from_dict(_item) for _item in obj["exit_toward_elements"]] if obj.get("exit_toward_elements") is not None else None,
|
127
|
+
"exit_name_elements": [ManeuverSignElement.from_dict(_item) for _item in obj["exit_name_elements"]] if obj.get("exit_name_elements") is not None else None
|
111
128
|
})
|
112
129
|
# store additional fields in additional_properties
|
113
130
|
for _key in obj.keys():
|
@@ -116,3 +133,4 @@ class ManeuverSign(BaseModel):
|
|
116
133
|
|
117
134
|
return _obj
|
118
135
|
|
136
|
+
|
@@ -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,45 +18,62 @@ 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, StrictInt, 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 ManeuverSignElement(BaseModel):
|
26
27
|
"""
|
27
28
|
ManeuverSignElement
|
28
|
-
"""
|
29
|
-
text: StrictStr = Field(
|
30
|
-
is_route_number: Optional[StrictBool] = Field(None, description="True if the sign is a route number.")
|
31
|
-
consecutive_count: Optional[StrictInt] = Field(None, description="The frequency of this sign element within a set a consecutive signs.")
|
29
|
+
""" # noqa: E501
|
30
|
+
text: StrictStr = Field(description="The interchange sign text (varies based on the context; see the `maneuverSign` schema).")
|
31
|
+
is_route_number: Optional[StrictBool] = Field(default=None, description="True if the sign is a route number.")
|
32
|
+
consecutive_count: Optional[StrictInt] = Field(default=None, description="The frequency of this sign element within a set a consecutive signs.")
|
32
33
|
additional_properties: Dict[str, Any] = {}
|
33
|
-
__properties = ["text", "is_route_number", "consecutive_count"]
|
34
|
+
__properties: ClassVar[List[str]] = ["text", "is_route_number", "consecutive_count"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
34
41
|
|
35
|
-
class Config:
|
36
|
-
"""Pydantic configuration"""
|
37
|
-
allow_population_by_field_name = True
|
38
|
-
validate_assignment = True
|
39
42
|
|
40
43
|
def to_str(self) -> str:
|
41
44
|
"""Returns the string representation of the model using alias"""
|
42
|
-
return pprint.pformat(self.
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
43
46
|
|
44
47
|
def to_json(self) -> str:
|
45
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
|
46
50
|
return json.dumps(self.to_dict())
|
47
51
|
|
48
52
|
@classmethod
|
49
|
-
def from_json(cls, json_str: str) ->
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
54
|
"""Create an instance of ManeuverSignElement from a JSON string"""
|
51
55
|
return cls.from_dict(json.loads(json_str))
|
52
56
|
|
53
|
-
def to_dict(self):
|
54
|
-
"""
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
+
)
|
60
77
|
# puts key-value pairs in additional_properties in the top level
|
61
78
|
if self.additional_properties is not None:
|
62
79
|
for _key, _value in self.additional_properties.items():
|
@@ -65,15 +82,15 @@ class ManeuverSignElement(BaseModel):
|
|
65
82
|
return _dict
|
66
83
|
|
67
84
|
@classmethod
|
68
|
-
def from_dict(cls, obj:
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
69
86
|
"""Create an instance of ManeuverSignElement from a dict"""
|
70
87
|
if obj is None:
|
71
88
|
return None
|
72
89
|
|
73
90
|
if not isinstance(obj, dict):
|
74
|
-
return
|
91
|
+
return cls.model_validate(obj)
|
75
92
|
|
76
|
-
_obj =
|
93
|
+
_obj = cls.model_validate({
|
77
94
|
"text": obj.get("text"),
|
78
95
|
"is_route_number": obj.get("is_route_number"),
|
79
96
|
"consecutive_count": obj.get("consecutive_count")
|
@@ -85,3 +102,4 @@ class ManeuverSignElement(BaseModel):
|
|
85
102
|
|
86
103
|
return _obj
|
87
104
|
|
105
|
+
|
@@ -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 MapMatchCostingModel(str, Enum):
|
@@ -36,8 +33,8 @@ class MapMatchCostingModel(str, Enum):
|
|
36
33
|
PEDESTRIAN = 'pedestrian'
|
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 MapMatchCostingModel from a JSON string"""
|
41
|
-
return
|
38
|
+
return cls(json.loads(json_str))
|
42
39
|
|
43
40
|
|