stadiamaps 1.0.6__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stadiamaps/__init__.py +6 -24
- stadiamaps/api/geocoding_api.py +1917 -760
- stadiamaps/api/geospatial_api.py +483 -221
- stadiamaps/api/routing_api.py +1615 -723
- stadiamaps/api_client.py +275 -272
- stadiamaps/api_response.py +12 -16
- stadiamaps/configuration.py +13 -11
- stadiamaps/exceptions.py +67 -30
- stadiamaps/models/__init__.py +5 -23
- stadiamaps/models/access.py +44 -26
- stadiamaps/models/admin_region.py +46 -28
- stadiamaps/models/administrative.py +48 -30
- stadiamaps/models/auto_costing_options.py +69 -48
- stadiamaps/models/auto_costing_options_all_of.py +1 -1
- stadiamaps/models/base_costing_options.py +52 -33
- stadiamaps/models/base_trace_request.py +70 -40
- stadiamaps/models/bicycle_costing_options.py +61 -42
- stadiamaps/models/bicycle_costing_options_all_of.py +1 -1
- stadiamaps/models/bike_network.py +42 -24
- stadiamaps/models/contour.py +45 -27
- stadiamaps/models/coordinate.py +45 -26
- stadiamaps/models/costing_model.py +10 -12
- stadiamaps/models/costing_options.py +51 -33
- stadiamaps/models/directions_options.py +45 -27
- stadiamaps/models/distance_unit.py +8 -11
- stadiamaps/models/edge_sign.py +46 -28
- stadiamaps/models/edge_use.py +8 -11
- stadiamaps/models/end_node.py +48 -30
- stadiamaps/models/geo_attributes.py +47 -29
- stadiamaps/models/geo_json_geometry.py +25 -25
- stadiamaps/models/geo_json_geometry_base.py +45 -27
- stadiamaps/models/geo_json_line_string.py +47 -28
- stadiamaps/models/geo_json_line_string_all_of.py +2 -2
- stadiamaps/models/geo_json_point.py +47 -28
- stadiamaps/models/geo_json_point_all_of.py +2 -2
- stadiamaps/models/geo_json_polygon.py +47 -28
- stadiamaps/models/geo_json_polygon_all_of.py +2 -2
- stadiamaps/models/geocoding_object.py +46 -28
- stadiamaps/models/height_request.py +55 -34
- stadiamaps/models/height_response.py +49 -30
- stadiamaps/models/highway_classification.py +52 -34
- stadiamaps/models/intersecting_edge.py +45 -27
- stadiamaps/models/isochrone_costing_model.py +8 -11
- stadiamaps/models/isochrone_feature.py +45 -27
- stadiamaps/models/isochrone_properties.py +48 -30
- stadiamaps/models/isochrone_request.py +54 -35
- stadiamaps/models/isochrone_response.py +47 -29
- stadiamaps/models/locate_detailed_edge.py +73 -55
- stadiamaps/models/locate_edge.py +56 -39
- stadiamaps/models/locate_edge_info.py +47 -29
- stadiamaps/models/locate_node.py +50 -31
- stadiamaps/models/locate_node_all_of.py +1 -1
- stadiamaps/models/locate_object.py +49 -31
- stadiamaps/models/maneuver_sign.py +50 -32
- stadiamaps/models/maneuver_sign_element.py +45 -27
- stadiamaps/models/map_match_costing_model.py +8 -11
- stadiamaps/models/map_match_request.py +74 -44
- stadiamaps/models/map_match_request_all_of.py +1 -1
- stadiamaps/models/map_match_route_response.py +57 -29
- stadiamaps/models/map_match_route_response_all_of.py +1 -1
- stadiamaps/models/map_match_trace_options.py +47 -29
- stadiamaps/models/map_match_waypoint.py +49 -30
- stadiamaps/models/map_match_waypoint_all_of.py +1 -1
- stadiamaps/models/matched_point.py +52 -34
- stadiamaps/models/matrix_costing_model.py +9 -12
- stadiamaps/models/matrix_distance.py +46 -28
- stadiamaps/models/matrix_request.py +70 -39
- stadiamaps/models/matrix_response.py +60 -36
- stadiamaps/models/motor_scooter_costing_options.py +70 -49
- stadiamaps/models/motor_scooter_costing_options_all_of.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +69 -48
- stadiamaps/models/motorcycle_costing_options_all_of.py +1 -1
- stadiamaps/models/nearest_roads_request.py +65 -34
- stadiamaps/models/node_id.py +42 -24
- stadiamaps/models/node_type.py +8 -11
- stadiamaps/models/optimized_route_request.py +66 -35
- stadiamaps/models/pedestrian_costing_options.py +59 -40
- stadiamaps/models/pelias_geo_json_feature.py +50 -31
- stadiamaps/models/pelias_geo_json_properties.py +54 -36
- stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
- stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
- stadiamaps/models/pelias_layer.py +8 -11
- stadiamaps/models/pelias_response.py +49 -30
- stadiamaps/models/pelias_response_geocoding.py +1 -1
- stadiamaps/models/pelias_source.py +8 -11
- stadiamaps/models/restrictions.py +44 -26
- stadiamaps/models/road_class.py +8 -11
- stadiamaps/models/route_leg.py +48 -29
- stadiamaps/models/route_maneuver.py +73 -55
- stadiamaps/models/route_request.py +76 -43
- stadiamaps/models/route_response.py +56 -28
- stadiamaps/models/route_response_alternates_inner.py +105 -0
- stadiamaps/models/route_response_trip.py +1 -1
- stadiamaps/models/route_summary.py +48 -30
- stadiamaps/models/route_trip.py +135 -0
- stadiamaps/models/routing_response_waypoint.py +49 -30
- stadiamaps/models/routing_response_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint.py +60 -41
- stadiamaps/models/routing_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
- stadiamaps/models/simple_routing_waypoint.py +48 -29
- stadiamaps/models/simple_routing_waypoint_all_of.py +1 -1
- stadiamaps/models/speeds.py +49 -31
- stadiamaps/models/trace_attribute_filter_options.py +47 -28
- stadiamaps/models/trace_attribute_key.py +8 -11
- stadiamaps/models/trace_attributes_base_response.py +51 -32
- stadiamaps/models/trace_attributes_request.py +72 -42
- stadiamaps/models/trace_attributes_request_all_of.py +1 -1
- stadiamaps/models/trace_attributes_request_all_of_filters.py +2 -2
- stadiamaps/models/trace_attributes_response.py +54 -35
- stadiamaps/models/trace_attributes_response_all_of.py +1 -1
- stadiamaps/models/trace_edge.py +88 -70
- stadiamaps/models/travel_mode.py +8 -11
- stadiamaps/models/traversability.py +8 -11
- stadiamaps/models/truck_costing_options.py +72 -51
- stadiamaps/models/truck_costing_options_all_of.py +1 -1
- stadiamaps/models/tz_response.py +45 -27
- stadiamaps/models/valhalla_languages.py +8 -11
- stadiamaps/models/valhalla_long_units.py +8 -11
- stadiamaps/models/warning.py +42 -24
- stadiamaps/py.typed +0 -0
- stadiamaps/rest.py +127 -172
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/METADATA +4 -4
- stadiamaps-2.0.0.dist-info/RECORD +128 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/WHEEL +1 -1
- stadiamaps-1.0.6.dist-info/RECORD +0 -125
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/top_level.txt +0 -0
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,52 +18,70 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import List
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing_extensions import Annotated
|
24
24
|
from stadiamaps.models.trace_attribute_key import TraceAttributeKey
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
25
27
|
|
26
28
|
class TraceAttributeFilterOptions(BaseModel):
|
27
29
|
"""
|
28
30
|
TraceAttributeFilterOptions
|
29
|
-
"""
|
30
|
-
attributes:
|
31
|
-
action: StrictStr = Field(
|
31
|
+
""" # noqa: E501
|
32
|
+
attributes: Annotated[List[TraceAttributeKey], Field(min_length=1)]
|
33
|
+
action: StrictStr = Field(description="Determines whether the list of attributes will be used as a whitelist or a blacklist.")
|
32
34
|
additional_properties: Dict[str, Any] = {}
|
33
|
-
__properties = ["attributes", "action"]
|
35
|
+
__properties: ClassVar[List[str]] = ["attributes", "action"]
|
34
36
|
|
35
|
-
@
|
37
|
+
@field_validator('action')
|
36
38
|
def action_validate_enum(cls, value):
|
37
39
|
"""Validates the enum"""
|
38
|
-
if value not in ('include', 'exclude'):
|
40
|
+
if value not in set(['include', 'exclude']):
|
39
41
|
raise ValueError("must be one of enum values ('include', 'exclude')")
|
40
42
|
return value
|
41
43
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
model_config = ConfigDict(
|
45
|
+
populate_by_name=True,
|
46
|
+
validate_assignment=True,
|
47
|
+
protected_namespaces=(),
|
48
|
+
)
|
49
|
+
|
46
50
|
|
47
51
|
def to_str(self) -> str:
|
48
52
|
"""Returns the string representation of the model using alias"""
|
49
|
-
return pprint.pformat(self.
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
50
54
|
|
51
55
|
def to_json(self) -> str:
|
52
56
|
"""Returns the JSON representation of the model using alias"""
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
53
58
|
return json.dumps(self.to_dict())
|
54
59
|
|
55
60
|
@classmethod
|
56
|
-
def from_json(cls, json_str: str) ->
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
57
62
|
"""Create an instance of TraceAttributeFilterOptions from a JSON string"""
|
58
63
|
return cls.from_dict(json.loads(json_str))
|
59
64
|
|
60
|
-
def to_dict(self):
|
61
|
-
"""
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
67
|
+
|
68
|
+
This has the following differences from calling pydantic's
|
69
|
+
`self.model_dump(by_alias=True)`:
|
70
|
+
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
72
|
+
were set at model initialization. Other fields with value `None`
|
73
|
+
are ignored.
|
74
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
75
|
+
"""
|
76
|
+
excluded_fields: Set[str] = set([
|
77
|
+
"additional_properties",
|
78
|
+
])
|
79
|
+
|
80
|
+
_dict = self.model_dump(
|
81
|
+
by_alias=True,
|
82
|
+
exclude=excluded_fields,
|
83
|
+
exclude_none=True,
|
84
|
+
)
|
67
85
|
# puts key-value pairs in additional_properties in the top level
|
68
86
|
if self.additional_properties is not None:
|
69
87
|
for _key, _value in self.additional_properties.items():
|
@@ -72,15 +90,15 @@ class TraceAttributeFilterOptions(BaseModel):
|
|
72
90
|
return _dict
|
73
91
|
|
74
92
|
@classmethod
|
75
|
-
def from_dict(cls, obj:
|
93
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
76
94
|
"""Create an instance of TraceAttributeFilterOptions from a dict"""
|
77
95
|
if obj is None:
|
78
96
|
return None
|
79
97
|
|
80
98
|
if not isinstance(obj, dict):
|
81
|
-
return
|
99
|
+
return cls.model_validate(obj)
|
82
100
|
|
83
|
-
_obj =
|
101
|
+
_obj = cls.model_validate({
|
84
102
|
"attributes": obj.get("attributes"),
|
85
103
|
"action": obj.get("action")
|
86
104
|
})
|
@@ -91,3 +109,4 @@ class TraceAttributeFilterOptions(BaseModel):
|
|
91
109
|
|
92
110
|
return _obj
|
93
111
|
|
112
|
+
|
@@ -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 TraceAttributeKey(str, Enum):
|
@@ -100,8 +97,8 @@ class TraceAttributeKey(str, Enum):
|
|
100
97
|
MATCHED_DOT_DISTANCE_FROM_TRACE_POINT = 'matched.distance_from_trace_point'
|
101
98
|
|
102
99
|
@classmethod
|
103
|
-
def from_json(cls, json_str: str) ->
|
100
|
+
def from_json(cls, json_str: str) -> Self:
|
104
101
|
"""Create an instance of TraceAttributeKey from a JSON string"""
|
105
|
-
return
|
102
|
+
return cls(json.loads(json_str))
|
106
103
|
|
107
104
|
|
@@ -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,51 +18,69 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import List, Optional, Union
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing_extensions import Annotated
|
24
24
|
from stadiamaps.models.admin_region import AdminRegion
|
25
25
|
from stadiamaps.models.matched_point import MatchedPoint
|
26
26
|
from stadiamaps.models.trace_edge import TraceEdge
|
27
|
+
from typing import Optional, Set
|
28
|
+
from typing_extensions import Self
|
27
29
|
|
28
30
|
class TraceAttributesBaseResponse(BaseModel):
|
29
31
|
"""
|
30
32
|
TraceAttributesBaseResponse
|
31
|
-
"""
|
32
|
-
edges: Optional[
|
33
|
-
admins: Optional[
|
34
|
-
matched_points: Optional[
|
33
|
+
""" # noqa: E501
|
34
|
+
edges: Optional[List[TraceEdge]] = Field(default=None, description="The list of edges matched along the path.")
|
35
|
+
admins: Optional[List[AdminRegion]] = Field(default=None, description="The set of administrative regions matched along the path. Rather than repeating this information for every end node, the admins in this list are referenced by index.")
|
36
|
+
matched_points: Optional[List[MatchedPoint]] = Field(default=None, description="List of match results when using the map_snap shape match algorithm. There is a one-to-one correspondence with the input set of latitude, longitude coordinates and this list of match results.")
|
35
37
|
osm_changeset: Optional[StrictInt] = None
|
36
|
-
shape: Optional[StrictStr] = Field(None, description="The encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) of the matched path.")
|
37
|
-
confidence_score: Optional[Union[
|
38
|
+
shape: Optional[StrictStr] = Field(default=None, description="The encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) of the matched path.")
|
39
|
+
confidence_score: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = None
|
38
40
|
additional_properties: Dict[str, Any] = {}
|
39
|
-
__properties = ["edges", "admins", "matched_points", "osm_changeset", "shape", "confidence_score"]
|
41
|
+
__properties: ClassVar[List[str]] = ["edges", "admins", "matched_points", "osm_changeset", "shape", "confidence_score"]
|
42
|
+
|
43
|
+
model_config = ConfigDict(
|
44
|
+
populate_by_name=True,
|
45
|
+
validate_assignment=True,
|
46
|
+
protected_namespaces=(),
|
47
|
+
)
|
40
48
|
|
41
|
-
class Config:
|
42
|
-
"""Pydantic configuration"""
|
43
|
-
allow_population_by_field_name = True
|
44
|
-
validate_assignment = True
|
45
49
|
|
46
50
|
def to_str(self) -> str:
|
47
51
|
"""Returns the string representation of the model using alias"""
|
48
|
-
return pprint.pformat(self.
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
49
53
|
|
50
54
|
def to_json(self) -> str:
|
51
55
|
"""Returns the JSON representation of the model using alias"""
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
52
57
|
return json.dumps(self.to_dict())
|
53
58
|
|
54
59
|
@classmethod
|
55
|
-
def from_json(cls, json_str: str) ->
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
56
61
|
"""Create an instance of TraceAttributesBaseResponse from a JSON string"""
|
57
62
|
return cls.from_dict(json.loads(json_str))
|
58
63
|
|
59
|
-
def to_dict(self):
|
60
|
-
"""
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
66
|
+
|
67
|
+
This has the following differences from calling pydantic's
|
68
|
+
`self.model_dump(by_alias=True)`:
|
69
|
+
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
71
|
+
were set at model initialization. Other fields with value `None`
|
72
|
+
are ignored.
|
73
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
74
|
+
"""
|
75
|
+
excluded_fields: Set[str] = set([
|
76
|
+
"additional_properties",
|
77
|
+
])
|
78
|
+
|
79
|
+
_dict = self.model_dump(
|
80
|
+
by_alias=True,
|
81
|
+
exclude=excluded_fields,
|
82
|
+
exclude_none=True,
|
83
|
+
)
|
66
84
|
# override the default output from pydantic by calling `to_dict()` of each item in edges (list)
|
67
85
|
_items = []
|
68
86
|
if self.edges:
|
@@ -92,18 +110,18 @@ class TraceAttributesBaseResponse(BaseModel):
|
|
92
110
|
return _dict
|
93
111
|
|
94
112
|
@classmethod
|
95
|
-
def from_dict(cls, obj:
|
113
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
96
114
|
"""Create an instance of TraceAttributesBaseResponse from a dict"""
|
97
115
|
if obj is None:
|
98
116
|
return None
|
99
117
|
|
100
118
|
if not isinstance(obj, dict):
|
101
|
-
return
|
119
|
+
return cls.model_validate(obj)
|
102
120
|
|
103
|
-
_obj =
|
104
|
-
"edges": [TraceEdge.from_dict(_item) for _item in obj
|
105
|
-
"admins": [AdminRegion.from_dict(_item) for _item in obj
|
106
|
-
"matched_points": [MatchedPoint.from_dict(_item) for _item in obj
|
121
|
+
_obj = cls.model_validate({
|
122
|
+
"edges": [TraceEdge.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None,
|
123
|
+
"admins": [AdminRegion.from_dict(_item) for _item in obj["admins"]] if obj.get("admins") is not None else None,
|
124
|
+
"matched_points": [MatchedPoint.from_dict(_item) for _item in obj["matched_points"]] if obj.get("matched_points") is not None else None,
|
107
125
|
"osm_changeset": obj.get("osm_changeset"),
|
108
126
|
"shape": obj.get("shape"),
|
109
127
|
"confidence_score": obj.get("confidence_score")
|
@@ -115,3 +133,4 @@ class TraceAttributesBaseResponse(BaseModel):
|
|
115
133
|
|
116
134
|
return _obj
|
117
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,65 +18,95 @@ 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, StrictStr, conlist, validator
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
24
23
|
from stadiamaps.models.costing_options import CostingOptions
|
25
|
-
from stadiamaps.models.
|
24
|
+
from stadiamaps.models.distance_unit import DistanceUnit
|
26
25
|
from stadiamaps.models.map_match_costing_model import MapMatchCostingModel
|
27
26
|
from stadiamaps.models.map_match_waypoint import MapMatchWaypoint
|
28
|
-
from stadiamaps.models.
|
27
|
+
from stadiamaps.models.trace_attribute_filter_options import TraceAttributeFilterOptions
|
28
|
+
from stadiamaps.models.valhalla_languages import ValhallaLanguages
|
29
|
+
from typing import Optional, Set
|
30
|
+
from typing_extensions import Self
|
29
31
|
|
30
32
|
class TraceAttributesRequest(BaseModel):
|
31
33
|
"""
|
32
34
|
TraceAttributesRequest
|
33
|
-
"""
|
34
|
-
id: Optional[StrictStr] = Field(None, description="An identifier to disambiguate requests (echoed by the server).")
|
35
|
-
shape: Optional[
|
36
|
-
encoded_polyline: Optional[StrictStr] = Field(None, description="REQUIRED if `shape` is not present. An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm). Note that the polyline must be encoded with 6 digits of precision rather than the usual 5.")
|
37
|
-
costing: MapMatchCostingModel
|
35
|
+
""" # noqa: E501
|
36
|
+
id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
|
37
|
+
shape: Optional[List[MapMatchWaypoint]] = Field(default=None, description="REQUIRED if `encoded_polyline` is not present. Note that `break` type locations are only supported when `shape_match` is set to `map_match`.")
|
38
|
+
encoded_polyline: Optional[StrictStr] = Field(default=None, description="REQUIRED if `shape` is not present. An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm). Note that the polyline must be encoded with 6 digits of precision rather than the usual 5.")
|
39
|
+
costing: MapMatchCostingModel
|
38
40
|
costing_options: Optional[CostingOptions] = None
|
39
|
-
shape_match: Optional[StrictStr] = Field(None, description="Three snapping modes provide some control over how the map matching occurs. `edge_walk` is fast, but requires extremely precise data that matches the route graph almost perfectly. `map_snap` can handle significantly noisier data, but is very expensive. `walk_or_snap`, the default, tries to use edge walking first and falls back to map matching if edge walking fails. In general, you should not need to change this parameter unless you want to trace a multi-leg route with multiple `break` locations in the `shape`.")
|
40
|
-
|
41
|
-
|
41
|
+
shape_match: Optional[StrictStr] = Field(default=None, description="Three snapping modes provide some control over how the map matching occurs. `edge_walk` is fast, but requires extremely precise data that matches the route graph almost perfectly. `map_snap` can handle significantly noisier data, but is very expensive. `walk_or_snap`, the default, tries to use edge walking first and falls back to map matching if edge walking fails. In general, you should not need to change this parameter unless you want to trace a multi-leg route with multiple `break` locations in the `shape`.")
|
42
|
+
units: Optional[DistanceUnit] = None
|
43
|
+
language: Optional[ValhallaLanguages] = None
|
44
|
+
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.")
|
45
|
+
filters: Optional[TraceAttributeFilterOptions] = Field(default=None, description="If present, provides either a whitelist or a blacklist of keys to include/exclude in the response. This key is optional, and if omitted from the request, all available info will be returned.")
|
42
46
|
additional_properties: Dict[str, Any] = {}
|
43
|
-
__properties = ["id", "shape", "encoded_polyline", "costing", "costing_options", "shape_match", "
|
47
|
+
__properties: ClassVar[List[str]] = ["id", "shape", "encoded_polyline", "costing", "costing_options", "shape_match", "units", "language", "directions_type", "filters"]
|
44
48
|
|
45
|
-
@
|
49
|
+
@field_validator('shape_match')
|
46
50
|
def shape_match_validate_enum(cls, value):
|
47
51
|
"""Validates the enum"""
|
48
52
|
if value is None:
|
49
53
|
return value
|
50
54
|
|
51
|
-
if value not in ('edge_walk', 'map_snap', 'walk_or_snap'):
|
55
|
+
if value not in set(['edge_walk', 'map_snap', 'walk_or_snap']):
|
52
56
|
raise ValueError("must be one of enum values ('edge_walk', 'map_snap', 'walk_or_snap')")
|
53
57
|
return value
|
54
58
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
+
@field_validator('directions_type')
|
60
|
+
def directions_type_validate_enum(cls, value):
|
61
|
+
"""Validates the enum"""
|
62
|
+
if value is None:
|
63
|
+
return value
|
64
|
+
|
65
|
+
if value not in set(['none', 'maneuvers', 'instructions']):
|
66
|
+
raise ValueError("must be one of enum values ('none', 'maneuvers', 'instructions')")
|
67
|
+
return value
|
68
|
+
|
69
|
+
model_config = ConfigDict(
|
70
|
+
populate_by_name=True,
|
71
|
+
validate_assignment=True,
|
72
|
+
protected_namespaces=(),
|
73
|
+
)
|
74
|
+
|
59
75
|
|
60
76
|
def to_str(self) -> str:
|
61
77
|
"""Returns the string representation of the model using alias"""
|
62
|
-
return pprint.pformat(self.
|
78
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
63
79
|
|
64
80
|
def to_json(self) -> str:
|
65
81
|
"""Returns the JSON representation of the model using alias"""
|
82
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
66
83
|
return json.dumps(self.to_dict())
|
67
84
|
|
68
85
|
@classmethod
|
69
|
-
def from_json(cls, json_str: str) ->
|
86
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
70
87
|
"""Create an instance of TraceAttributesRequest from a JSON string"""
|
71
88
|
return cls.from_dict(json.loads(json_str))
|
72
89
|
|
73
|
-
def to_dict(self):
|
74
|
-
"""
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
90
|
+
def to_dict(self) -> Dict[str, Any]:
|
91
|
+
"""Return the dictionary representation of the model using alias.
|
92
|
+
|
93
|
+
This has the following differences from calling pydantic's
|
94
|
+
`self.model_dump(by_alias=True)`:
|
95
|
+
|
96
|
+
* `None` is only added to the output dict for nullable fields that
|
97
|
+
were set at model initialization. Other fields with value `None`
|
98
|
+
are ignored.
|
99
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
100
|
+
"""
|
101
|
+
excluded_fields: Set[str] = set([
|
102
|
+
"additional_properties",
|
103
|
+
])
|
104
|
+
|
105
|
+
_dict = self.model_dump(
|
106
|
+
by_alias=True,
|
107
|
+
exclude=excluded_fields,
|
108
|
+
exclude_none=True,
|
109
|
+
)
|
80
110
|
# override the default output from pydantic by calling `to_dict()` of each item in shape (list)
|
81
111
|
_items = []
|
82
112
|
if self.shape:
|
@@ -87,9 +117,6 @@ class TraceAttributesRequest(BaseModel):
|
|
87
117
|
# override the default output from pydantic by calling `to_dict()` of costing_options
|
88
118
|
if self.costing_options:
|
89
119
|
_dict['costing_options'] = self.costing_options.to_dict()
|
90
|
-
# override the default output from pydantic by calling `to_dict()` of directions_options
|
91
|
-
if self.directions_options:
|
92
|
-
_dict['directions_options'] = self.directions_options.to_dict()
|
93
120
|
# override the default output from pydantic by calling `to_dict()` of filters
|
94
121
|
if self.filters:
|
95
122
|
_dict['filters'] = self.filters.to_dict()
|
@@ -101,23 +128,25 @@ class TraceAttributesRequest(BaseModel):
|
|
101
128
|
return _dict
|
102
129
|
|
103
130
|
@classmethod
|
104
|
-
def from_dict(cls, obj:
|
131
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
105
132
|
"""Create an instance of TraceAttributesRequest from a dict"""
|
106
133
|
if obj is None:
|
107
134
|
return None
|
108
135
|
|
109
136
|
if not isinstance(obj, dict):
|
110
|
-
return
|
137
|
+
return cls.model_validate(obj)
|
111
138
|
|
112
|
-
_obj =
|
139
|
+
_obj = cls.model_validate({
|
113
140
|
"id": obj.get("id"),
|
114
|
-
"shape": [MapMatchWaypoint.from_dict(_item) for _item in obj
|
141
|
+
"shape": [MapMatchWaypoint.from_dict(_item) for _item in obj["shape"]] if obj.get("shape") is not None else None,
|
115
142
|
"encoded_polyline": obj.get("encoded_polyline"),
|
116
143
|
"costing": obj.get("costing"),
|
117
|
-
"costing_options": CostingOptions.from_dict(obj
|
144
|
+
"costing_options": CostingOptions.from_dict(obj["costing_options"]) if obj.get("costing_options") is not None else None,
|
118
145
|
"shape_match": obj.get("shape_match"),
|
119
|
-
"
|
120
|
-
"
|
146
|
+
"units": obj.get("units"),
|
147
|
+
"language": obj.get("language"),
|
148
|
+
"directions_type": obj.get("directions_type") if obj.get("directions_type") is not None else 'instructions',
|
149
|
+
"filters": TraceAttributeFilterOptions.from_dict(obj["filters"]) if obj.get("filters") is not None else None
|
121
150
|
})
|
122
151
|
# store additional fields in additional_properties
|
123
152
|
for _key in obj.keys():
|
@@ -126,3 +155,4 @@ class TraceAttributesRequest(BaseModel):
|
|
126
155
|
|
127
156
|
return _obj
|
128
157
|
|
158
|
+
|
@@ -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
|
|
@@ -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
|
|
@@ -27,7 +27,7 @@ class TraceAttributesRequestAllOfFilters(BaseModel):
|
|
27
27
|
"""
|
28
28
|
If present, provides either a whitelist or a blacklist of keys to include/exclude in the response. This key is optional, and if omitted from the request, all available info will be returned.
|
29
29
|
"""
|
30
|
-
attributes: conlist(TraceAttributeKey,
|
30
|
+
attributes: conlist(TraceAttributeKey, min_length=1) = Field(...)
|
31
31
|
action: StrictStr = Field(..., description="Determines whether the list of attributes will be used as a whitelist or a blacklist.")
|
32
32
|
additional_properties: Dict[str, Any] = {}
|
33
33
|
__properties = ["attributes", "action"]
|