stadiamaps 3.2.0__py3-none-any.whl → 4.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 +24 -4
- stadiamaps/api/geocoding_api.py +1 -1
- stadiamaps/api/geospatial_api.py +1 -1
- stadiamaps/api/routing_api.py +12 -12
- stadiamaps/api_client.py +9 -2
- stadiamaps/configuration.py +3 -3
- stadiamaps/exceptions.py +1 -1
- stadiamaps/models/__init__.py +23 -3
- 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 +4 -4
- stadiamaps/models/bicycle_costing_options.py +1 -1
- stadiamaps/models/bike_network.py +1 -1
- stadiamaps/models/bulk_request.py +80 -104
- stadiamaps/models/bulk_request_query.py +138 -0
- stadiamaps/models/bulk_search_response.py +1 -1
- 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 +1 -1
- 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/geocoding_object.py +1 -1
- 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 +17 -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 +27 -5
- 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 +7 -7
- stadiamaps/models/matrix_response.py +13 -13
- 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 +4 -4
- stadiamaps/models/node_id.py +1 -1
- stadiamaps/models/node_type.py +1 -1
- stadiamaps/models/optimized_route_request.py +28 -6
- 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/pelias_geo_json_feature.py +1 -1
- stadiamaps/models/pelias_geo_json_properties.py +1 -1
- stadiamaps/models/pelias_geo_json_properties_addendum.py +1 -1
- stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +1 -1
- stadiamaps/models/pelias_layer.py +1 -1
- stadiamaps/models/pelias_response.py +4 -4
- stadiamaps/models/pelias_source.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 +30 -8
- 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 +7 -7
- 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 +1 -1
- stadiamaps/models/search_structured_query.py +1 -1
- 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 +15 -10
- stadiamaps/models/trace_attributes_request.py +4 -4
- stadiamaps/models/trace_attributes_response.py +18 -13
- 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/valhalla_languages.py +1 -1
- stadiamaps/models/valhalla_long_units.py +1 -1
- stadiamaps/models/warning.py +1 -1
- stadiamaps/rest.py +1 -1
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.0.dist-info}/METADATA +1 -1
- stadiamaps-4.0.0.dist-info/RECORD +160 -0
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.0.dist-info}/WHEEL +1 -1
- stadiamaps-3.2.0.dist-info/RECORD +0 -138
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.0.dist-info}/top_level.txt +0 -0
stadiamaps/models/node_id.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: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/node_type.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: 7.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: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -18,9 +18,10 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
23
23
|
from typing_extensions import Annotated
|
24
|
+
from stadiamaps.models.annotation_filters import AnnotationFilters
|
24
25
|
from stadiamaps.models.coordinate import Coordinate
|
25
26
|
from stadiamaps.models.costing_options import CostingOptions
|
26
27
|
from stadiamaps.models.distance_unit import DistanceUnit
|
@@ -36,12 +37,16 @@ class OptimizedRouteRequest(BaseModel):
|
|
36
37
|
units: Optional[DistanceUnit] = DistanceUnit.KM
|
37
38
|
language: Optional[ValhallaLanguages] = ValhallaLanguages.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[Coordinate], Field(min_length=3)] = Field(description="The list of locations. The first and last are assumed to be the start and end points, and all intermediate points are locations that you want to visit along the way.")
|
41
46
|
costing: MatrixCostingModel
|
42
47
|
costing_options: Optional[CostingOptions] = None
|
43
48
|
additional_properties: Dict[str, Any] = {}
|
44
|
-
__properties: ClassVar[List[str]] = ["units", "language", "directions_type", "id", "locations", "costing", "costing_options"]
|
49
|
+
__properties: ClassVar[List[str]] = ["units", "language", "directions_type", "format", "banner_instructions", "voice_instructions", "filters", "id", "locations", "costing", "costing_options"]
|
45
50
|
|
46
51
|
@field_validator('directions_type')
|
47
52
|
def directions_type_validate_enum(cls, value):
|
@@ -53,6 +58,16 @@ class OptimizedRouteRequest(BaseModel):
|
|
53
58
|
raise ValueError("must be one of enum values ('none', 'maneuvers', 'instructions')")
|
54
59
|
return value
|
55
60
|
|
61
|
+
@field_validator('format')
|
62
|
+
def format_validate_enum(cls, value):
|
63
|
+
"""Validates the enum"""
|
64
|
+
if value is None:
|
65
|
+
return value
|
66
|
+
|
67
|
+
if value not in set(['json', 'osrm']):
|
68
|
+
raise ValueError("must be one of enum values ('json', 'osrm')")
|
69
|
+
return value
|
70
|
+
|
56
71
|
model_config = ConfigDict(
|
57
72
|
populate_by_name=True,
|
58
73
|
validate_assignment=True,
|
@@ -94,12 +109,15 @@ class OptimizedRouteRequest(BaseModel):
|
|
94
109
|
exclude=excluded_fields,
|
95
110
|
exclude_none=True,
|
96
111
|
)
|
112
|
+
# override the default output from pydantic by calling `to_dict()` of filters
|
113
|
+
if self.filters:
|
114
|
+
_dict['filters'] = self.filters.to_dict()
|
97
115
|
# override the default output from pydantic by calling `to_dict()` of each item in locations (list)
|
98
116
|
_items = []
|
99
117
|
if self.locations:
|
100
|
-
for
|
101
|
-
if
|
102
|
-
_items.append(
|
118
|
+
for _item_locations in self.locations:
|
119
|
+
if _item_locations:
|
120
|
+
_items.append(_item_locations.to_dict())
|
103
121
|
_dict['locations'] = _items
|
104
122
|
# override the default output from pydantic by calling `to_dict()` of costing_options
|
105
123
|
if self.costing_options:
|
@@ -124,6 +142,10 @@ class OptimizedRouteRequest(BaseModel):
|
|
124
142
|
"units": obj.get("units") if obj.get("units") is not None else DistanceUnit.KM,
|
125
143
|
"language": obj.get("language") if obj.get("language") is not None else ValhallaLanguages.EN_MINUS_US,
|
126
144
|
"directions_type": obj.get("directions_type") if obj.get("directions_type") is not None else 'instructions',
|
145
|
+
"format": obj.get("format"),
|
146
|
+
"banner_instructions": obj.get("banner_instructions"),
|
147
|
+
"voice_instructions": obj.get("voice_instructions"),
|
148
|
+
"filters": AnnotationFilters.from_dict(obj["filters"]) if obj.get("filters") is not None else None,
|
127
149
|
"id": obj.get("id"),
|
128
150
|
"locations": [Coordinate.from_dict(_item) for _item in obj["locations"]] if obj.get("locations") is not None else None,
|
129
151
|
"costing": obj.get("costing"),
|
@@ -0,0 +1,103 @@
|
|
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: 7.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, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class OsrmAdmin(BaseModel):
|
27
|
+
"""
|
28
|
+
OsrmAdmin
|
29
|
+
""" # noqa: E501
|
30
|
+
iso_3166_1: Optional[StrictStr] = Field(default=None, description="The ISO 3166-1 two-character code for the admin region.")
|
31
|
+
iso_3166_1_alpha3: Optional[StrictStr] = Field(default=None, description="The ISO 3166-1 three-character code for the admin region.")
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
33
|
+
__properties: ClassVar[List[str]] = ["iso_3166_1", "iso_3166_1_alpha3"]
|
34
|
+
|
35
|
+
model_config = ConfigDict(
|
36
|
+
populate_by_name=True,
|
37
|
+
validate_assignment=True,
|
38
|
+
protected_namespaces=(),
|
39
|
+
)
|
40
|
+
|
41
|
+
|
42
|
+
def to_str(self) -> str:
|
43
|
+
"""Returns the string representation of the model using alias"""
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
|
+
|
46
|
+
def to_json(self) -> str:
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
49
|
+
return json.dumps(self.to_dict())
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
+
"""Create an instance of OsrmAdmin from a JSON string"""
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
55
|
+
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
58
|
+
|
59
|
+
This has the following differences from calling pydantic's
|
60
|
+
`self.model_dump(by_alias=True)`:
|
61
|
+
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
63
|
+
were set at model initialization. Other fields with value `None`
|
64
|
+
are ignored.
|
65
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
66
|
+
"""
|
67
|
+
excluded_fields: Set[str] = set([
|
68
|
+
"additional_properties",
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
76
|
+
# puts key-value pairs in additional_properties in the top level
|
77
|
+
if self.additional_properties is not None:
|
78
|
+
for _key, _value in self.additional_properties.items():
|
79
|
+
_dict[_key] = _value
|
80
|
+
|
81
|
+
return _dict
|
82
|
+
|
83
|
+
@classmethod
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
85
|
+
"""Create an instance of OsrmAdmin from a dict"""
|
86
|
+
if obj is None:
|
87
|
+
return None
|
88
|
+
|
89
|
+
if not isinstance(obj, dict):
|
90
|
+
return cls.model_validate(obj)
|
91
|
+
|
92
|
+
_obj = cls.model_validate({
|
93
|
+
"iso_3166_1": obj.get("iso_3166_1"),
|
94
|
+
"iso_3166_1_alpha3": obj.get("iso_3166_1_alpha3")
|
95
|
+
})
|
96
|
+
# store additional fields in additional_properties
|
97
|
+
for _key in obj.keys():
|
98
|
+
if _key not in cls.__properties:
|
99
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
100
|
+
|
101
|
+
return _obj
|
102
|
+
|
103
|
+
|
@@ -0,0 +1,117 @@
|
|
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: 7.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
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from stadiamaps.models.osrm_speed_limit import OsrmSpeedLimit
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class OsrmAnnotation(BaseModel):
|
28
|
+
"""
|
29
|
+
OsrmAnnotation
|
30
|
+
""" # noqa: E501
|
31
|
+
distance: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="The distance, in meters, between each pair of coordinates.")
|
32
|
+
duration: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="The duration between each pair of coordinates, in seconds.")
|
33
|
+
weight: Optional[List[StrictInt]] = None
|
34
|
+
speed: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="The estimated speed of travel between each pair of coordinates in meters/sec.")
|
35
|
+
maxspeed: Optional[List[OsrmSpeedLimit]] = None
|
36
|
+
additional_properties: Dict[str, Any] = {}
|
37
|
+
__properties: ClassVar[List[str]] = ["distance", "duration", "weight", "speed", "maxspeed"]
|
38
|
+
|
39
|
+
model_config = ConfigDict(
|
40
|
+
populate_by_name=True,
|
41
|
+
validate_assignment=True,
|
42
|
+
protected_namespaces=(),
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
def to_str(self) -> str:
|
47
|
+
"""Returns the string representation of the model using alias"""
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
49
|
+
|
50
|
+
def to_json(self) -> str:
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
53
|
+
return json.dumps(self.to_dict())
|
54
|
+
|
55
|
+
@classmethod
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
57
|
+
"""Create an instance of OsrmAnnotation from a JSON string"""
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
59
|
+
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
62
|
+
|
63
|
+
This has the following differences from calling pydantic's
|
64
|
+
`self.model_dump(by_alias=True)`:
|
65
|
+
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
67
|
+
were set at model initialization. Other fields with value `None`
|
68
|
+
are ignored.
|
69
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
70
|
+
"""
|
71
|
+
excluded_fields: Set[str] = set([
|
72
|
+
"additional_properties",
|
73
|
+
])
|
74
|
+
|
75
|
+
_dict = self.model_dump(
|
76
|
+
by_alias=True,
|
77
|
+
exclude=excluded_fields,
|
78
|
+
exclude_none=True,
|
79
|
+
)
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of each item in maxspeed (list)
|
81
|
+
_items = []
|
82
|
+
if self.maxspeed:
|
83
|
+
for _item_maxspeed in self.maxspeed:
|
84
|
+
if _item_maxspeed:
|
85
|
+
_items.append(_item_maxspeed.to_dict())
|
86
|
+
_dict['maxspeed'] = _items
|
87
|
+
# puts key-value pairs in additional_properties in the top level
|
88
|
+
if self.additional_properties is not None:
|
89
|
+
for _key, _value in self.additional_properties.items():
|
90
|
+
_dict[_key] = _value
|
91
|
+
|
92
|
+
return _dict
|
93
|
+
|
94
|
+
@classmethod
|
95
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
96
|
+
"""Create an instance of OsrmAnnotation from a dict"""
|
97
|
+
if obj is None:
|
98
|
+
return None
|
99
|
+
|
100
|
+
if not isinstance(obj, dict):
|
101
|
+
return cls.model_validate(obj)
|
102
|
+
|
103
|
+
_obj = cls.model_validate({
|
104
|
+
"distance": obj.get("distance"),
|
105
|
+
"duration": obj.get("duration"),
|
106
|
+
"weight": obj.get("weight"),
|
107
|
+
"speed": obj.get("speed"),
|
108
|
+
"maxspeed": [OsrmSpeedLimit.from_dict(_item) for _item in obj["maxspeed"]] if obj.get("maxspeed") is not None else None
|
109
|
+
})
|
110
|
+
# store additional fields in additional_properties
|
111
|
+
for _key in obj.keys():
|
112
|
+
if _key not in cls.__properties:
|
113
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
114
|
+
|
115
|
+
return _obj
|
116
|
+
|
117
|
+
|
@@ -0,0 +1,113 @@
|
|
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: 7.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, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class OsrmBannerComponent(BaseModel):
|
27
|
+
"""
|
28
|
+
OsrmBannerComponent
|
29
|
+
""" # noqa: E501
|
30
|
+
text: Optional[StrictStr] = None
|
31
|
+
type: Optional[StrictStr] = None
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
33
|
+
__properties: ClassVar[List[str]] = ["text", "type"]
|
34
|
+
|
35
|
+
@field_validator('type')
|
36
|
+
def type_validate_enum(cls, value):
|
37
|
+
"""Validates the enum"""
|
38
|
+
if value is None:
|
39
|
+
return value
|
40
|
+
|
41
|
+
if value not in set(['text', 'icon', 'delimiter', 'exit-number', 'exit', 'lane']):
|
42
|
+
raise ValueError("must be one of enum values ('text', 'icon', 'delimiter', 'exit-number', 'exit', 'lane')")
|
43
|
+
return value
|
44
|
+
|
45
|
+
model_config = ConfigDict(
|
46
|
+
populate_by_name=True,
|
47
|
+
validate_assignment=True,
|
48
|
+
protected_namespaces=(),
|
49
|
+
)
|
50
|
+
|
51
|
+
|
52
|
+
def to_str(self) -> str:
|
53
|
+
"""Returns the string representation of the model using alias"""
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
55
|
+
|
56
|
+
def to_json(self) -> str:
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
59
|
+
return json.dumps(self.to_dict())
|
60
|
+
|
61
|
+
@classmethod
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
63
|
+
"""Create an instance of OsrmBannerComponent from a JSON string"""
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
65
|
+
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
68
|
+
|
69
|
+
This has the following differences from calling pydantic's
|
70
|
+
`self.model_dump(by_alias=True)`:
|
71
|
+
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
73
|
+
were set at model initialization. Other fields with value `None`
|
74
|
+
are ignored.
|
75
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
76
|
+
"""
|
77
|
+
excluded_fields: Set[str] = set([
|
78
|
+
"additional_properties",
|
79
|
+
])
|
80
|
+
|
81
|
+
_dict = self.model_dump(
|
82
|
+
by_alias=True,
|
83
|
+
exclude=excluded_fields,
|
84
|
+
exclude_none=True,
|
85
|
+
)
|
86
|
+
# puts key-value pairs in additional_properties in the top level
|
87
|
+
if self.additional_properties is not None:
|
88
|
+
for _key, _value in self.additional_properties.items():
|
89
|
+
_dict[_key] = _value
|
90
|
+
|
91
|
+
return _dict
|
92
|
+
|
93
|
+
@classmethod
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
95
|
+
"""Create an instance of OsrmBannerComponent from a dict"""
|
96
|
+
if obj is None:
|
97
|
+
return None
|
98
|
+
|
99
|
+
if not isinstance(obj, dict):
|
100
|
+
return cls.model_validate(obj)
|
101
|
+
|
102
|
+
_obj = cls.model_validate({
|
103
|
+
"text": obj.get("text"),
|
104
|
+
"type": obj.get("type")
|
105
|
+
})
|
106
|
+
# store additional fields in additional_properties
|
107
|
+
for _key in obj.keys():
|
108
|
+
if _key not in cls.__properties:
|
109
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
110
|
+
|
111
|
+
return _obj
|
112
|
+
|
113
|
+
|
@@ -0,0 +1,131 @@
|
|
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: 7.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, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from stadiamaps.models.osrm_banner_component import OsrmBannerComponent
|
24
|
+
from stadiamaps.models.osrm_guidance_modifier import OsrmGuidanceModifier
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
class OsrmBannerContent(BaseModel):
|
29
|
+
"""
|
30
|
+
OsrmBannerContent
|
31
|
+
""" # noqa: E501
|
32
|
+
text: StrictStr
|
33
|
+
type: Optional[StrictStr] = None
|
34
|
+
modifier: Optional[OsrmGuidanceModifier] = None
|
35
|
+
components: Optional[List[OsrmBannerComponent]] = Field(default=None, description="A list of objects with additional context that allow for visual layout improvements beyond what's possible with plain text.")
|
36
|
+
additional_properties: Dict[str, Any] = {}
|
37
|
+
__properties: ClassVar[List[str]] = ["text", "type", "modifier", "components"]
|
38
|
+
|
39
|
+
@field_validator('type')
|
40
|
+
def type_validate_enum(cls, value):
|
41
|
+
"""Validates the enum"""
|
42
|
+
if value is None:
|
43
|
+
return value
|
44
|
+
|
45
|
+
if value not in set(['turn', 'new name', 'depart', 'arrive', 'merge', 'on ramp', 'off ramp', 'fork', 'end of road', 'continue', 'roundabout', 'rotary', 'roundabout turn', 'notification', 'exit roundabout', 'exit rotary']):
|
46
|
+
raise ValueError("must be one of enum values ('turn', 'new name', 'depart', 'arrive', 'merge', 'on ramp', 'off ramp', 'fork', 'end of road', 'continue', 'roundabout', 'rotary', 'roundabout turn', 'notification', 'exit roundabout', 'exit rotary')")
|
47
|
+
return value
|
48
|
+
|
49
|
+
model_config = ConfigDict(
|
50
|
+
populate_by_name=True,
|
51
|
+
validate_assignment=True,
|
52
|
+
protected_namespaces=(),
|
53
|
+
)
|
54
|
+
|
55
|
+
|
56
|
+
def to_str(self) -> str:
|
57
|
+
"""Returns the string representation of the model using alias"""
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
59
|
+
|
60
|
+
def to_json(self) -> str:
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
63
|
+
return json.dumps(self.to_dict())
|
64
|
+
|
65
|
+
@classmethod
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
67
|
+
"""Create an instance of OsrmBannerContent from a JSON string"""
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
69
|
+
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
72
|
+
|
73
|
+
This has the following differences from calling pydantic's
|
74
|
+
`self.model_dump(by_alias=True)`:
|
75
|
+
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
77
|
+
were set at model initialization. Other fields with value `None`
|
78
|
+
are ignored.
|
79
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
80
|
+
"""
|
81
|
+
excluded_fields: Set[str] = set([
|
82
|
+
"additional_properties",
|
83
|
+
])
|
84
|
+
|
85
|
+
_dict = self.model_dump(
|
86
|
+
by_alias=True,
|
87
|
+
exclude=excluded_fields,
|
88
|
+
exclude_none=True,
|
89
|
+
)
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of each item in components (list)
|
91
|
+
_items = []
|
92
|
+
if self.components:
|
93
|
+
for _item_components in self.components:
|
94
|
+
if _item_components:
|
95
|
+
_items.append(_item_components.to_dict())
|
96
|
+
_dict['components'] = _items
|
97
|
+
# puts key-value pairs in additional_properties in the top level
|
98
|
+
if self.additional_properties is not None:
|
99
|
+
for _key, _value in self.additional_properties.items():
|
100
|
+
_dict[_key] = _value
|
101
|
+
|
102
|
+
# set to None if modifier (nullable) is None
|
103
|
+
# and model_fields_set contains the field
|
104
|
+
if self.modifier is None and "modifier" in self.model_fields_set:
|
105
|
+
_dict['modifier'] = None
|
106
|
+
|
107
|
+
return _dict
|
108
|
+
|
109
|
+
@classmethod
|
110
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
111
|
+
"""Create an instance of OsrmBannerContent from a dict"""
|
112
|
+
if obj is None:
|
113
|
+
return None
|
114
|
+
|
115
|
+
if not isinstance(obj, dict):
|
116
|
+
return cls.model_validate(obj)
|
117
|
+
|
118
|
+
_obj = cls.model_validate({
|
119
|
+
"text": obj.get("text"),
|
120
|
+
"type": obj.get("type"),
|
121
|
+
"modifier": obj.get("modifier"),
|
122
|
+
"components": [OsrmBannerComponent.from_dict(_item) for _item in obj["components"]] if obj.get("components") is not None else None
|
123
|
+
})
|
124
|
+
# store additional fields in additional_properties
|
125
|
+
for _key in obj.keys():
|
126
|
+
if _key not in cls.__properties:
|
127
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
128
|
+
|
129
|
+
return _obj
|
130
|
+
|
131
|
+
|
@@ -0,0 +1,112 @@
|
|
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: 7.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
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from stadiamaps.models.osrm_banner_content import OsrmBannerContent
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class OsrmBannerInstruction(BaseModel):
|
28
|
+
"""
|
29
|
+
OsrmBannerInstruction
|
30
|
+
""" # noqa: E501
|
31
|
+
distance_along_geometry: Union[StrictFloat, StrictInt] = Field(description="How far (in meters) from the upcoming maneuver the instruction should start being displayed.", alias="distanceAlongGeometry")
|
32
|
+
primary: OsrmBannerContent
|
33
|
+
secondary: Optional[OsrmBannerContent] = None
|
34
|
+
additional_properties: Dict[str, Any] = {}
|
35
|
+
__properties: ClassVar[List[str]] = ["distanceAlongGeometry", "primary", "secondary"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
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
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of OsrmBannerInstruction from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
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
|
+
)
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of primary
|
79
|
+
if self.primary:
|
80
|
+
_dict['primary'] = self.primary.to_dict()
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of secondary
|
82
|
+
if self.secondary:
|
83
|
+
_dict['secondary'] = self.secondary.to_dict()
|
84
|
+
# puts key-value pairs in additional_properties in the top level
|
85
|
+
if self.additional_properties is not None:
|
86
|
+
for _key, _value in self.additional_properties.items():
|
87
|
+
_dict[_key] = _value
|
88
|
+
|
89
|
+
return _dict
|
90
|
+
|
91
|
+
@classmethod
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
|
+
"""Create an instance of OsrmBannerInstruction from a dict"""
|
94
|
+
if obj is None:
|
95
|
+
return None
|
96
|
+
|
97
|
+
if not isinstance(obj, dict):
|
98
|
+
return cls.model_validate(obj)
|
99
|
+
|
100
|
+
_obj = cls.model_validate({
|
101
|
+
"distanceAlongGeometry": obj.get("distanceAlongGeometry"),
|
102
|
+
"primary": OsrmBannerContent.from_dict(obj["primary"]) if obj.get("primary") is not None else None,
|
103
|
+
"secondary": OsrmBannerContent.from_dict(obj["secondary"]) if obj.get("secondary") is not None else None
|
104
|
+
})
|
105
|
+
# store additional fields in additional_properties
|
106
|
+
for _key in obj.keys():
|
107
|
+
if _key not in cls.__properties:
|
108
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
109
|
+
|
110
|
+
return _obj
|
111
|
+
|
112
|
+
|