stadiamaps 3.2.1__py3-none-any.whl → 5.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 +32 -11
- stadiamaps/api/geocoding_api.py +128 -116
- stadiamaps/api/geospatial_api.py +7 -3
- stadiamaps/api/routing_api.py +33 -19
- stadiamaps/api_client.py +21 -5
- stadiamaps/configuration.py +156 -40
- stadiamaps/exceptions.py +1 -1
- stadiamaps/models/__init__.py +31 -10
- stadiamaps/models/access.py +1 -1
- stadiamaps/models/admin_region.py +1 -1
- stadiamaps/models/administrative.py +1 -1
- stadiamaps/models/annotation_filters.py +124 -0
- stadiamaps/models/auto_costing_options.py +1 -1
- stadiamaps/models/base_costing_options.py +1 -1
- stadiamaps/models/base_trace_request.py +7 -7
- stadiamaps/models/bicycle_costing_options.py +1 -1
- stadiamaps/models/bike_network.py +1 -1
- stadiamaps/models/bulk_request.py +1 -1
- stadiamaps/models/bulk_request_query.py +1 -1
- stadiamaps/models/bulk_search_response.py +4 -4
- stadiamaps/models/contour.py +1 -1
- stadiamaps/models/coordinate.py +1 -1
- stadiamaps/models/costing_model.py +1 -1
- stadiamaps/models/costing_options.py +1 -1
- stadiamaps/models/directions_options.py +4 -4
- stadiamaps/models/distance_unit.py +1 -1
- stadiamaps/models/edge_sign.py +1 -1
- stadiamaps/models/edge_use.py +1 -1
- stadiamaps/models/end_node.py +4 -4
- stadiamaps/models/extended_directions_options.py +121 -0
- stadiamaps/models/geo_attributes.py +1 -1
- stadiamaps/models/geo_json_geometry.py +1 -1
- stadiamaps/models/geo_json_geometry_base.py +1 -1
- stadiamaps/models/geo_json_line_string.py +1 -1
- stadiamaps/models/geo_json_point.py +1 -1
- stadiamaps/models/geo_json_polygon.py +1 -1
- stadiamaps/models/{pelias_response.py → geocode_response.py} +11 -11
- stadiamaps/models/{pelias_geo_json_feature.py → geocoding_geo_json_feature.py} +8 -8
- stadiamaps/models/{pelias_geo_json_properties.py → geocoding_geo_json_properties.py} +40 -14
- stadiamaps/models/{pelias_geo_json_properties_addendum.py → geocoding_geo_json_properties_addendum.py} +7 -7
- stadiamaps/models/{pelias_geo_json_properties_addendum_osm.py → geocoding_geo_json_properties_addendum_osm.py} +5 -5
- stadiamaps/models/{pelias_layer.py → geocoding_layer.py} +3 -3
- stadiamaps/models/geocoding_object.py +1 -1
- stadiamaps/models/{pelias_source.py → geocoding_source.py} +4 -3
- stadiamaps/models/height_request.py +4 -4
- stadiamaps/models/height_response.py +4 -4
- stadiamaps/models/highway_classification.py +1 -1
- stadiamaps/models/intersecting_edge.py +1 -1
- stadiamaps/models/isochrone_costing_model.py +1 -1
- stadiamaps/models/isochrone_feature.py +1 -1
- stadiamaps/models/isochrone_properties.py +1 -1
- stadiamaps/models/isochrone_request.py +7 -7
- stadiamaps/models/isochrone_response.py +4 -4
- stadiamaps/models/locate_detailed_edge.py +1 -1
- stadiamaps/models/locate_edge.py +1 -1
- stadiamaps/models/locate_edge_info.py +1 -1
- stadiamaps/models/locate_node.py +1 -1
- stadiamaps/models/locate_object.py +7 -7
- stadiamaps/models/low_speed_vehicle_costing_options.py +1 -1
- stadiamaps/models/maneuver_sign.py +13 -13
- stadiamaps/models/maneuver_sign_element.py +1 -1
- stadiamaps/models/map_match_costing_model.py +1 -1
- stadiamaps/models/map_match_request.py +35 -11
- stadiamaps/models/map_match_route_response.py +4 -4
- stadiamaps/models/map_match_trace_options.py +1 -1
- stadiamaps/models/map_match_waypoint.py +1 -1
- stadiamaps/models/matched_point.py +1 -1
- stadiamaps/models/matrix_costing_model.py +1 -1
- stadiamaps/models/matrix_distance.py +1 -1
- stadiamaps/models/matrix_request.py +10 -10
- stadiamaps/models/matrix_response.py +16 -16
- stadiamaps/models/matrix_waypoint.py +1 -1
- stadiamaps/models/motor_scooter_costing_options.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +1 -1
- stadiamaps/models/nearest_roads_request.py +7 -7
- stadiamaps/models/node_id.py +1 -1
- stadiamaps/models/node_type.py +1 -1
- stadiamaps/models/optimized_route_request.py +35 -11
- stadiamaps/models/osrm_admin.py +103 -0
- stadiamaps/models/osrm_annotation.py +117 -0
- stadiamaps/models/osrm_banner_component.py +113 -0
- stadiamaps/models/osrm_banner_content.py +131 -0
- stadiamaps/models/osrm_banner_instruction.py +112 -0
- stadiamaps/models/osrm_base_api_response.py +112 -0
- stadiamaps/models/osrm_guidance_modifier.py +44 -0
- stadiamaps/models/osrm_intersection.py +145 -0
- stadiamaps/models/osrm_lane.py +111 -0
- stadiamaps/models/osrm_route.py +119 -0
- stadiamaps/models/osrm_route_leg.py +148 -0
- stadiamaps/models/osrm_route_response.py +132 -0
- stadiamaps/models/osrm_route_step.py +185 -0
- stadiamaps/models/osrm_speed_limit.py +117 -0
- stadiamaps/models/osrm_step_maneuver.py +127 -0
- stadiamaps/models/osrm_via_waypoint.py +105 -0
- stadiamaps/models/osrm_voice_instruction.py +105 -0
- stadiamaps/models/osrm_waypoint.py +108 -0
- stadiamaps/models/pedestrian_costing_options.py +1 -1
- stadiamaps/models/restrictions.py +1 -1
- stadiamaps/models/road_class.py +1 -1
- stadiamaps/models/route200_response.py +138 -0
- stadiamaps/models/route_leg.py +4 -4
- stadiamaps/models/route_maneuver.py +1 -1
- stadiamaps/models/route_request.py +34 -12
- stadiamaps/models/route_response.py +4 -4
- stadiamaps/models/route_response_alternates_inner.py +1 -1
- stadiamaps/models/route_summary.py +1 -1
- stadiamaps/models/route_trip.py +13 -13
- stadiamaps/models/{valhalla_languages.py → routing_languages.py} +4 -4
- stadiamaps/models/{valhalla_long_units.py → routing_long_units.py} +4 -4
- stadiamaps/models/routing_response_waypoint.py +1 -1
- stadiamaps/models/routing_waypoint.py +1 -1
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +1 -1
- stadiamaps/models/search_query.py +6 -6
- stadiamaps/models/search_structured_query.py +6 -6
- stadiamaps/models/simple_routing_waypoint.py +1 -1
- stadiamaps/models/speeds.py +1 -1
- stadiamaps/models/trace_attribute_filter_options.py +1 -1
- stadiamaps/models/trace_attribute_key.py +1 -1
- stadiamaps/models/trace_attributes_base_response.py +10 -10
- stadiamaps/models/trace_attributes_request.py +13 -11
- stadiamaps/models/trace_attributes_response.py +16 -16
- stadiamaps/models/trace_edge.py +2 -2
- stadiamaps/models/travel_mode.py +1 -1
- stadiamaps/models/traversability.py +1 -1
- stadiamaps/models/truck_costing_options.py +1 -1
- stadiamaps/models/tz_response.py +1 -1
- stadiamaps/models/warning.py +1 -1
- stadiamaps/rest.py +2 -2
- {stadiamaps-3.2.1.dist-info → stadiamaps-5.0.0.dist-info}/METADATA +14 -6
- stadiamaps-5.0.0.dist-info/RECORD +157 -0
- {stadiamaps-3.2.1.dist-info → stadiamaps-5.0.0.dist-info}/WHEEL +1 -1
- stadiamaps/models/pelias_response_geocoding.py +0 -89
- stadiamaps/models/route_response_trip.py +0 -117
- stadiamaps/models/trace_attributes_response_all_of.py +0 -96
- stadiamaps-3.2.1.dist-info/RECORD +0 -139
- {stadiamaps-3.2.1.dist-info → stadiamaps-5.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-3.2.1.dist-info → stadiamaps-5.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 8.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class OsrmVoiceInstruction(BaseModel):
|
27
|
+
"""
|
28
|
+
OsrmVoiceInstruction
|
29
|
+
""" # noqa: E501
|
30
|
+
distance_along_geometry: Union[StrictFloat, StrictInt] = Field(description="How far (in meters) from the upcoming maneuver the instruction should be announced.", alias="distanceAlongGeometry")
|
31
|
+
announcement: StrictStr = Field(description="The plain-text announcement.")
|
32
|
+
ssml_announcement: Optional[StrictStr] = Field(default=None, description="The announcement in Speech Synthesis Markup Language (SSML). Supported TTS engines include Amazon Polly and Apple's AVSpeechSynthesizer.", alias="ssmlAnnouncement")
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
34
|
+
__properties: ClassVar[List[str]] = ["distanceAlongGeometry", "announcement", "ssmlAnnouncement"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
def to_str(self) -> str:
|
44
|
+
"""Returns the string representation of the model using alias"""
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
+
|
47
|
+
def to_json(self) -> str:
|
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
|
50
|
+
return json.dumps(self.to_dict())
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
+
"""Create an instance of OsrmVoiceInstruction from a JSON string"""
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
56
|
+
|
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
|
+
)
|
77
|
+
# puts key-value pairs in additional_properties in the top level
|
78
|
+
if self.additional_properties is not None:
|
79
|
+
for _key, _value in self.additional_properties.items():
|
80
|
+
_dict[_key] = _value
|
81
|
+
|
82
|
+
return _dict
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
86
|
+
"""Create an instance of OsrmVoiceInstruction from a dict"""
|
87
|
+
if obj is None:
|
88
|
+
return None
|
89
|
+
|
90
|
+
if not isinstance(obj, dict):
|
91
|
+
return cls.model_validate(obj)
|
92
|
+
|
93
|
+
_obj = cls.model_validate({
|
94
|
+
"distanceAlongGeometry": obj.get("distanceAlongGeometry"),
|
95
|
+
"announcement": obj.get("announcement"),
|
96
|
+
"ssmlAnnouncement": obj.get("ssmlAnnouncement")
|
97
|
+
})
|
98
|
+
# store additional fields in additional_properties
|
99
|
+
for _key in obj.keys():
|
100
|
+
if _key not in cls.__properties:
|
101
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
102
|
+
|
103
|
+
return _obj
|
104
|
+
|
105
|
+
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 8.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class OsrmWaypoint(BaseModel):
|
28
|
+
"""
|
29
|
+
OsrmWaypoint
|
30
|
+
""" # noqa: E501
|
31
|
+
name: Optional[StrictStr] = None
|
32
|
+
location: Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=2)] = Field(description="A (longitude, latitude) coordinate pair.")
|
33
|
+
distance: Union[StrictFloat, StrictInt] = Field(description="The distance of the snapped point from the original location.")
|
34
|
+
hint: Optional[StrictStr] = None
|
35
|
+
additional_properties: Dict[str, Any] = {}
|
36
|
+
__properties: ClassVar[List[str]] = ["name", "location", "distance", "hint"]
|
37
|
+
|
38
|
+
model_config = ConfigDict(
|
39
|
+
populate_by_name=True,
|
40
|
+
validate_assignment=True,
|
41
|
+
protected_namespaces=(),
|
42
|
+
)
|
43
|
+
|
44
|
+
|
45
|
+
def to_str(self) -> str:
|
46
|
+
"""Returns the string representation of the model using alias"""
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
48
|
+
|
49
|
+
def to_json(self) -> str:
|
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
|
52
|
+
return json.dumps(self.to_dict())
|
53
|
+
|
54
|
+
@classmethod
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
56
|
+
"""Create an instance of OsrmWaypoint from a JSON string"""
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
58
|
+
|
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
|
+
)
|
79
|
+
# puts key-value pairs in additional_properties in the top level
|
80
|
+
if self.additional_properties is not None:
|
81
|
+
for _key, _value in self.additional_properties.items():
|
82
|
+
_dict[_key] = _value
|
83
|
+
|
84
|
+
return _dict
|
85
|
+
|
86
|
+
@classmethod
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
88
|
+
"""Create an instance of OsrmWaypoint from a dict"""
|
89
|
+
if obj is None:
|
90
|
+
return None
|
91
|
+
|
92
|
+
if not isinstance(obj, dict):
|
93
|
+
return cls.model_validate(obj)
|
94
|
+
|
95
|
+
_obj = cls.model_validate({
|
96
|
+
"name": obj.get("name"),
|
97
|
+
"location": obj.get("location"),
|
98
|
+
"distance": obj.get("distance"),
|
99
|
+
"hint": obj.get("hint")
|
100
|
+
})
|
101
|
+
# store additional fields in additional_properties
|
102
|
+
for _key in obj.keys():
|
103
|
+
if _key not in cls.__properties:
|
104
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
105
|
+
|
106
|
+
return _obj
|
107
|
+
|
108
|
+
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/road_class.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 8.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import json
|
18
|
+
import pprint
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
20
|
+
from typing import Any, List, Optional
|
21
|
+
from stadiamaps.models.osrm_route_response import OsrmRouteResponse
|
22
|
+
from stadiamaps.models.route_response import RouteResponse
|
23
|
+
from pydantic import StrictStr, Field
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
25
|
+
from typing_extensions import Literal, Self
|
26
|
+
|
27
|
+
ROUTE200RESPONSE_ONE_OF_SCHEMAS = ["OsrmRouteResponse", "RouteResponse"]
|
28
|
+
|
29
|
+
class Route200Response(BaseModel):
|
30
|
+
"""
|
31
|
+
Route200Response
|
32
|
+
"""
|
33
|
+
# data type: RouteResponse
|
34
|
+
oneof_schema_1_validator: Optional[RouteResponse] = None
|
35
|
+
# data type: OsrmRouteResponse
|
36
|
+
oneof_schema_2_validator: Optional[OsrmRouteResponse] = None
|
37
|
+
actual_instance: Optional[Union[OsrmRouteResponse, RouteResponse]] = None
|
38
|
+
one_of_schemas: Set[str] = { "OsrmRouteResponse", "RouteResponse" }
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
validate_assignment=True,
|
42
|
+
protected_namespaces=(),
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
def __init__(self, *args, **kwargs) -> None:
|
47
|
+
if args:
|
48
|
+
if len(args) > 1:
|
49
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
50
|
+
if kwargs:
|
51
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
52
|
+
super().__init__(actual_instance=args[0])
|
53
|
+
else:
|
54
|
+
super().__init__(**kwargs)
|
55
|
+
|
56
|
+
@field_validator('actual_instance')
|
57
|
+
def actual_instance_must_validate_oneof(cls, v):
|
58
|
+
instance = Route200Response.model_construct()
|
59
|
+
error_messages = []
|
60
|
+
match = 0
|
61
|
+
# validate data type: RouteResponse
|
62
|
+
if not isinstance(v, RouteResponse):
|
63
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `RouteResponse`")
|
64
|
+
else:
|
65
|
+
match += 1
|
66
|
+
# validate data type: OsrmRouteResponse
|
67
|
+
if not isinstance(v, OsrmRouteResponse):
|
68
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `OsrmRouteResponse`")
|
69
|
+
else:
|
70
|
+
match += 1
|
71
|
+
if match > 1:
|
72
|
+
# more than 1 match
|
73
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in Route200Response with oneOf schemas: OsrmRouteResponse, RouteResponse. Details: " + ", ".join(error_messages))
|
74
|
+
elif match == 0:
|
75
|
+
# no match
|
76
|
+
raise ValueError("No match found when setting `actual_instance` in Route200Response with oneOf schemas: OsrmRouteResponse, RouteResponse. Details: " + ", ".join(error_messages))
|
77
|
+
else:
|
78
|
+
return v
|
79
|
+
|
80
|
+
@classmethod
|
81
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
82
|
+
return cls.from_json(json.dumps(obj))
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def from_json(cls, json_str: str) -> Self:
|
86
|
+
"""Returns the object represented by the json string"""
|
87
|
+
instance = cls.model_construct()
|
88
|
+
error_messages = []
|
89
|
+
match = 0
|
90
|
+
|
91
|
+
# deserialize data into RouteResponse
|
92
|
+
try:
|
93
|
+
instance.actual_instance = RouteResponse.from_json(json_str)
|
94
|
+
match += 1
|
95
|
+
except (ValidationError, ValueError) as e:
|
96
|
+
error_messages.append(str(e))
|
97
|
+
# deserialize data into OsrmRouteResponse
|
98
|
+
try:
|
99
|
+
instance.actual_instance = OsrmRouteResponse.from_json(json_str)
|
100
|
+
match += 1
|
101
|
+
except (ValidationError, ValueError) as e:
|
102
|
+
error_messages.append(str(e))
|
103
|
+
|
104
|
+
if match > 1:
|
105
|
+
# more than 1 match
|
106
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into Route200Response with oneOf schemas: OsrmRouteResponse, RouteResponse. Details: " + ", ".join(error_messages))
|
107
|
+
elif match == 0:
|
108
|
+
# no match
|
109
|
+
raise ValueError("No match found when deserializing the JSON string into Route200Response with oneOf schemas: OsrmRouteResponse, RouteResponse. Details: " + ", ".join(error_messages))
|
110
|
+
else:
|
111
|
+
return instance
|
112
|
+
|
113
|
+
def to_json(self) -> str:
|
114
|
+
"""Returns the JSON representation of the actual instance"""
|
115
|
+
if self.actual_instance is None:
|
116
|
+
return "null"
|
117
|
+
|
118
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
119
|
+
return self.actual_instance.to_json()
|
120
|
+
else:
|
121
|
+
return json.dumps(self.actual_instance)
|
122
|
+
|
123
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], OsrmRouteResponse, RouteResponse]]:
|
124
|
+
"""Returns the dict representation of the actual instance"""
|
125
|
+
if self.actual_instance is None:
|
126
|
+
return None
|
127
|
+
|
128
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
129
|
+
return self.actual_instance.to_dict()
|
130
|
+
else:
|
131
|
+
# primitive type
|
132
|
+
return self.actual_instance
|
133
|
+
|
134
|
+
def to_str(self) -> str:
|
135
|
+
"""Returns the string representation of the actual instance"""
|
136
|
+
return pprint.pformat(self.model_dump())
|
137
|
+
|
138
|
+
|
stadiamaps/models/route_leg.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -82,9 +82,9 @@ class RouteLeg(BaseModel):
|
|
82
82
|
# override the default output from pydantic by calling `to_dict()` of each item in maneuvers (list)
|
83
83
|
_items = []
|
84
84
|
if self.maneuvers:
|
85
|
-
for
|
86
|
-
if
|
87
|
-
_items.append(
|
85
|
+
for _item_maneuvers in self.maneuvers:
|
86
|
+
if _item_maneuvers:
|
87
|
+
_items.append(_item_maneuvers.to_dict())
|
88
88
|
_dict['maneuvers'] = _items
|
89
89
|
# override the default output from pydantic by calling `to_dict()` of summary
|
90
90
|
if self.summary:
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -21,11 +21,12 @@ import json
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
23
|
from typing_extensions import Annotated
|
24
|
+
from stadiamaps.models.annotation_filters import AnnotationFilters
|
24
25
|
from stadiamaps.models.costing_model import CostingModel
|
25
26
|
from stadiamaps.models.costing_options import CostingOptions
|
26
27
|
from stadiamaps.models.distance_unit import DistanceUnit
|
28
|
+
from stadiamaps.models.routing_languages import RoutingLanguages
|
27
29
|
from stadiamaps.models.routing_waypoint import RoutingWaypoint
|
28
|
-
from stadiamaps.models.valhalla_languages import ValhallaLanguages
|
29
30
|
from typing import Optional, Set
|
30
31
|
from typing_extensions import Self
|
31
32
|
|
@@ -34,8 +35,12 @@ class RouteRequest(BaseModel):
|
|
34
35
|
RouteRequest
|
35
36
|
""" # noqa: E501
|
36
37
|
units: Optional[DistanceUnit] = DistanceUnit.KM
|
37
|
-
language: Optional[
|
38
|
+
language: Optional[RoutingLanguages] = RoutingLanguages.EN_MINUS_US
|
38
39
|
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.")
|
40
|
+
format: Optional[StrictStr] = Field(default=None, description="The output response format. The default JSON format is extremely compact and ideal for web or data-constrained use cases where you want to fetch additional attributes on demand in small chunks. The OSRM format is much richer and is configurable with significantly more info for turn-by-turn navigation use cases.")
|
41
|
+
banner_instructions: Optional[StrictBool] = Field(default=None, description="Optionally includes helpful banners with timing information for turn-by-turn navigation. This is only available in the OSRM format.")
|
42
|
+
voice_instructions: Optional[StrictBool] = Field(default=None, description="Optionally includes voice instructions with timing information for turn-by-turn navigation. This is only available in the OSRM format.")
|
43
|
+
filters: Optional[AnnotationFilters] = None
|
39
44
|
id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
|
40
45
|
locations: Annotated[List[RoutingWaypoint], Field(min_length=2)]
|
41
46
|
costing: CostingModel
|
@@ -43,10 +48,10 @@ class RouteRequest(BaseModel):
|
|
43
48
|
exclude_locations: Optional[List[RoutingWaypoint]] = Field(default=None, description="This has the same format as the locations list. Locations are mapped to the closed road(s), and these road(s) are excluded from the route path computation.")
|
44
49
|
exclude_polygons: Optional[List[List[List[Union[StrictFloat, StrictInt]]]]] = Field(default=None, description="One or multiple exterior rings of polygons in the form of nested JSON arrays. Roads intersecting these rings will be avoided during path finding. Open rings will be closed automatically. If you only need to avoid a few specific roads, it's much more efficient to use `exclude_locations`.")
|
45
50
|
alternates: Optional[StrictInt] = Field(default=None, description="How many alternate routes are desired. Note that fewer or no alternates may be returned. Alternates are not yet supported on routes with more than 2 locations or on time-dependent routes.")
|
46
|
-
elevation_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.0, description="If greater than zero, attempts to include elevation along the route at regular intervals. The \"native\" internal resolution is 30m, so we recommend you use this when possible. This number is interpreted as either meters or feet depending on the unit parameter. Elevation for route sections containing a bridge or tunnel is interpolated linearly. This doesn't always match the true elevation of the bridge/tunnel, but it prevents sharp artifacts from the surrounding terrain. This functionality is unique to the
|
51
|
+
elevation_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.0, description="If greater than zero, attempts to include elevation along the route at regular intervals. The \"native\" internal resolution is 30m, so we recommend you use this when possible. This number is interpreted as either meters or feet depending on the unit parameter. Elevation for route sections containing a bridge or tunnel is interpolated linearly. This doesn't always match the true elevation of the bridge/tunnel, but it prevents sharp artifacts from the surrounding terrain. This functionality is unique to the routing endpoints and is not available via the elevation API. NOTE: This has no effect on the OSRM response format.")
|
47
52
|
roundabout_exits: Optional[StrictBool] = Field(default=True, description="Determines whether the output should include roundabout exit instructions.")
|
48
53
|
additional_properties: Dict[str, Any] = {}
|
49
|
-
__properties: ClassVar[List[str]] = ["units", "language", "directions_type", "id", "locations", "costing", "costing_options", "exclude_locations", "exclude_polygons", "alternates", "elevation_interval", "roundabout_exits"]
|
54
|
+
__properties: ClassVar[List[str]] = ["units", "language", "directions_type", "format", "banner_instructions", "voice_instructions", "filters", "id", "locations", "costing", "costing_options", "exclude_locations", "exclude_polygons", "alternates", "elevation_interval", "roundabout_exits"]
|
50
55
|
|
51
56
|
@field_validator('directions_type')
|
52
57
|
def directions_type_validate_enum(cls, value):
|
@@ -58,6 +63,16 @@ class RouteRequest(BaseModel):
|
|
58
63
|
raise ValueError("must be one of enum values ('none', 'maneuvers', 'instructions')")
|
59
64
|
return value
|
60
65
|
|
66
|
+
@field_validator('format')
|
67
|
+
def format_validate_enum(cls, value):
|
68
|
+
"""Validates the enum"""
|
69
|
+
if value is None:
|
70
|
+
return value
|
71
|
+
|
72
|
+
if value not in set(['json', 'osrm']):
|
73
|
+
raise ValueError("must be one of enum values ('json', 'osrm')")
|
74
|
+
return value
|
75
|
+
|
61
76
|
model_config = ConfigDict(
|
62
77
|
populate_by_name=True,
|
63
78
|
validate_assignment=True,
|
@@ -99,12 +114,15 @@ class RouteRequest(BaseModel):
|
|
99
114
|
exclude=excluded_fields,
|
100
115
|
exclude_none=True,
|
101
116
|
)
|
117
|
+
# override the default output from pydantic by calling `to_dict()` of filters
|
118
|
+
if self.filters:
|
119
|
+
_dict['filters'] = self.filters.to_dict()
|
102
120
|
# override the default output from pydantic by calling `to_dict()` of each item in locations (list)
|
103
121
|
_items = []
|
104
122
|
if self.locations:
|
105
|
-
for
|
106
|
-
if
|
107
|
-
_items.append(
|
123
|
+
for _item_locations in self.locations:
|
124
|
+
if _item_locations:
|
125
|
+
_items.append(_item_locations.to_dict())
|
108
126
|
_dict['locations'] = _items
|
109
127
|
# override the default output from pydantic by calling `to_dict()` of costing_options
|
110
128
|
if self.costing_options:
|
@@ -112,9 +130,9 @@ class RouteRequest(BaseModel):
|
|
112
130
|
# override the default output from pydantic by calling `to_dict()` of each item in exclude_locations (list)
|
113
131
|
_items = []
|
114
132
|
if self.exclude_locations:
|
115
|
-
for
|
116
|
-
if
|
117
|
-
_items.append(
|
133
|
+
for _item_exclude_locations in self.exclude_locations:
|
134
|
+
if _item_exclude_locations:
|
135
|
+
_items.append(_item_exclude_locations.to_dict())
|
118
136
|
_dict['exclude_locations'] = _items
|
119
137
|
# puts key-value pairs in additional_properties in the top level
|
120
138
|
if self.additional_properties is not None:
|
@@ -134,8 +152,12 @@ class RouteRequest(BaseModel):
|
|
134
152
|
|
135
153
|
_obj = cls.model_validate({
|
136
154
|
"units": obj.get("units") if obj.get("units") is not None else DistanceUnit.KM,
|
137
|
-
"language": obj.get("language") if obj.get("language") is not None else
|
155
|
+
"language": obj.get("language") if obj.get("language") is not None else RoutingLanguages.EN_MINUS_US,
|
138
156
|
"directions_type": obj.get("directions_type") if obj.get("directions_type") is not None else 'instructions',
|
157
|
+
"format": obj.get("format"),
|
158
|
+
"banner_instructions": obj.get("banner_instructions"),
|
159
|
+
"voice_instructions": obj.get("voice_instructions"),
|
160
|
+
"filters": AnnotationFilters.from_dict(obj["filters"]) if obj.get("filters") is not None else None,
|
139
161
|
"id": obj.get("id"),
|
140
162
|
"locations": [RoutingWaypoint.from_dict(_item) for _item in obj["locations"]] if obj.get("locations") is not None else None,
|
141
163
|
"costing": obj.get("costing"),
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -82,9 +82,9 @@ class RouteResponse(BaseModel):
|
|
82
82
|
# override the default output from pydantic by calling `to_dict()` of each item in alternates (list)
|
83
83
|
_items = []
|
84
84
|
if self.alternates:
|
85
|
-
for
|
86
|
-
if
|
87
|
-
_items.append(
|
85
|
+
for _item_alternates in self.alternates:
|
86
|
+
if _item_alternates:
|
87
|
+
_items.append(_item_alternates.to_dict())
|
88
88
|
_dict['alternates'] = _items
|
89
89
|
# puts key-value pairs in additional_properties in the top level
|
90
90
|
if self.additional_properties is not None:
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/route_trip.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -22,9 +22,9 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
23
23
|
from stadiamaps.models.route_leg import RouteLeg
|
24
24
|
from stadiamaps.models.route_summary import RouteSummary
|
25
|
+
from stadiamaps.models.routing_languages import RoutingLanguages
|
26
|
+
from stadiamaps.models.routing_long_units import RoutingLongUnits
|
25
27
|
from stadiamaps.models.routing_response_waypoint import RoutingResponseWaypoint
|
26
|
-
from stadiamaps.models.valhalla_languages import ValhallaLanguages
|
27
|
-
from stadiamaps.models.valhalla_long_units import ValhallaLongUnits
|
28
28
|
from typing import Optional, Set
|
29
29
|
from typing_extensions import Self
|
30
30
|
|
@@ -34,8 +34,8 @@ class RouteTrip(BaseModel):
|
|
34
34
|
""" # noqa: E501
|
35
35
|
status: StrictInt = Field(description="The response status code")
|
36
36
|
status_message: StrictStr = Field(description="The response status message")
|
37
|
-
units:
|
38
|
-
language:
|
37
|
+
units: RoutingLongUnits
|
38
|
+
language: RoutingLanguages
|
39
39
|
locations: List[RoutingResponseWaypoint]
|
40
40
|
legs: List[RouteLeg]
|
41
41
|
summary: RouteSummary
|
@@ -86,16 +86,16 @@ class RouteTrip(BaseModel):
|
|
86
86
|
# override the default output from pydantic by calling `to_dict()` of each item in locations (list)
|
87
87
|
_items = []
|
88
88
|
if self.locations:
|
89
|
-
for
|
90
|
-
if
|
91
|
-
_items.append(
|
89
|
+
for _item_locations in self.locations:
|
90
|
+
if _item_locations:
|
91
|
+
_items.append(_item_locations.to_dict())
|
92
92
|
_dict['locations'] = _items
|
93
93
|
# override the default output from pydantic by calling `to_dict()` of each item in legs (list)
|
94
94
|
_items = []
|
95
95
|
if self.legs:
|
96
|
-
for
|
97
|
-
if
|
98
|
-
_items.append(
|
96
|
+
for _item_legs in self.legs:
|
97
|
+
if _item_legs:
|
98
|
+
_items.append(_item_legs.to_dict())
|
99
99
|
_dict['legs'] = _items
|
100
100
|
# override the default output from pydantic by calling `to_dict()` of summary
|
101
101
|
if self.summary:
|
@@ -119,8 +119,8 @@ class RouteTrip(BaseModel):
|
|
119
119
|
_obj = cls.model_validate({
|
120
120
|
"status": obj.get("status"),
|
121
121
|
"status_message": obj.get("status_message"),
|
122
|
-
"units": obj.get("units") if obj.get("units") is not None else
|
123
|
-
"language": obj.get("language") if obj.get("language") is not None else
|
122
|
+
"units": obj.get("units") if obj.get("units") is not None else RoutingLongUnits.KILOMETERS,
|
123
|
+
"language": obj.get("language") if obj.get("language") is not None else RoutingLanguages.EN_MINUS_US,
|
124
124
|
"locations": [RoutingResponseWaypoint.from_dict(_item) for _item in obj["locations"]] if obj.get("locations") is not None else None,
|
125
125
|
"legs": [RouteLeg.from_dict(_item) for _item in obj["legs"]] if obj.get("legs") is not None else None,
|
126
126
|
"summary": RouteSummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None
|