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.
Files changed (128) hide show
  1. stadiamaps/__init__.py +6 -24
  2. stadiamaps/api/geocoding_api.py +1917 -760
  3. stadiamaps/api/geospatial_api.py +483 -221
  4. stadiamaps/api/routing_api.py +1615 -723
  5. stadiamaps/api_client.py +275 -272
  6. stadiamaps/api_response.py +12 -16
  7. stadiamaps/configuration.py +13 -11
  8. stadiamaps/exceptions.py +67 -30
  9. stadiamaps/models/__init__.py +5 -23
  10. stadiamaps/models/access.py +44 -26
  11. stadiamaps/models/admin_region.py +46 -28
  12. stadiamaps/models/administrative.py +48 -30
  13. stadiamaps/models/auto_costing_options.py +69 -48
  14. stadiamaps/models/auto_costing_options_all_of.py +1 -1
  15. stadiamaps/models/base_costing_options.py +52 -33
  16. stadiamaps/models/base_trace_request.py +70 -40
  17. stadiamaps/models/bicycle_costing_options.py +61 -42
  18. stadiamaps/models/bicycle_costing_options_all_of.py +1 -1
  19. stadiamaps/models/bike_network.py +42 -24
  20. stadiamaps/models/contour.py +45 -27
  21. stadiamaps/models/coordinate.py +45 -26
  22. stadiamaps/models/costing_model.py +10 -12
  23. stadiamaps/models/costing_options.py +51 -33
  24. stadiamaps/models/directions_options.py +45 -27
  25. stadiamaps/models/distance_unit.py +8 -11
  26. stadiamaps/models/edge_sign.py +46 -28
  27. stadiamaps/models/edge_use.py +8 -11
  28. stadiamaps/models/end_node.py +48 -30
  29. stadiamaps/models/geo_attributes.py +47 -29
  30. stadiamaps/models/geo_json_geometry.py +25 -25
  31. stadiamaps/models/geo_json_geometry_base.py +45 -27
  32. stadiamaps/models/geo_json_line_string.py +47 -28
  33. stadiamaps/models/geo_json_line_string_all_of.py +2 -2
  34. stadiamaps/models/geo_json_point.py +47 -28
  35. stadiamaps/models/geo_json_point_all_of.py +2 -2
  36. stadiamaps/models/geo_json_polygon.py +47 -28
  37. stadiamaps/models/geo_json_polygon_all_of.py +2 -2
  38. stadiamaps/models/geocoding_object.py +46 -28
  39. stadiamaps/models/height_request.py +55 -34
  40. stadiamaps/models/height_response.py +49 -30
  41. stadiamaps/models/highway_classification.py +52 -34
  42. stadiamaps/models/intersecting_edge.py +45 -27
  43. stadiamaps/models/isochrone_costing_model.py +8 -11
  44. stadiamaps/models/isochrone_feature.py +45 -27
  45. stadiamaps/models/isochrone_properties.py +48 -30
  46. stadiamaps/models/isochrone_request.py +54 -35
  47. stadiamaps/models/isochrone_response.py +47 -29
  48. stadiamaps/models/locate_detailed_edge.py +73 -55
  49. stadiamaps/models/locate_edge.py +56 -39
  50. stadiamaps/models/locate_edge_info.py +47 -29
  51. stadiamaps/models/locate_node.py +50 -31
  52. stadiamaps/models/locate_node_all_of.py +1 -1
  53. stadiamaps/models/locate_object.py +49 -31
  54. stadiamaps/models/maneuver_sign.py +50 -32
  55. stadiamaps/models/maneuver_sign_element.py +45 -27
  56. stadiamaps/models/map_match_costing_model.py +8 -11
  57. stadiamaps/models/map_match_request.py +74 -44
  58. stadiamaps/models/map_match_request_all_of.py +1 -1
  59. stadiamaps/models/map_match_route_response.py +57 -29
  60. stadiamaps/models/map_match_route_response_all_of.py +1 -1
  61. stadiamaps/models/map_match_trace_options.py +47 -29
  62. stadiamaps/models/map_match_waypoint.py +49 -30
  63. stadiamaps/models/map_match_waypoint_all_of.py +1 -1
  64. stadiamaps/models/matched_point.py +52 -34
  65. stadiamaps/models/matrix_costing_model.py +9 -12
  66. stadiamaps/models/matrix_distance.py +46 -28
  67. stadiamaps/models/matrix_request.py +70 -39
  68. stadiamaps/models/matrix_response.py +60 -36
  69. stadiamaps/models/motor_scooter_costing_options.py +70 -49
  70. stadiamaps/models/motor_scooter_costing_options_all_of.py +1 -1
  71. stadiamaps/models/motorcycle_costing_options.py +69 -48
  72. stadiamaps/models/motorcycle_costing_options_all_of.py +1 -1
  73. stadiamaps/models/nearest_roads_request.py +65 -34
  74. stadiamaps/models/node_id.py +42 -24
  75. stadiamaps/models/node_type.py +8 -11
  76. stadiamaps/models/optimized_route_request.py +66 -35
  77. stadiamaps/models/pedestrian_costing_options.py +59 -40
  78. stadiamaps/models/pelias_geo_json_feature.py +50 -31
  79. stadiamaps/models/pelias_geo_json_properties.py +54 -36
  80. stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
  81. stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
  82. stadiamaps/models/pelias_layer.py +8 -11
  83. stadiamaps/models/pelias_response.py +49 -30
  84. stadiamaps/models/pelias_response_geocoding.py +1 -1
  85. stadiamaps/models/pelias_source.py +8 -11
  86. stadiamaps/models/restrictions.py +44 -26
  87. stadiamaps/models/road_class.py +8 -11
  88. stadiamaps/models/route_leg.py +48 -29
  89. stadiamaps/models/route_maneuver.py +73 -55
  90. stadiamaps/models/route_request.py +76 -43
  91. stadiamaps/models/route_response.py +56 -28
  92. stadiamaps/models/route_response_alternates_inner.py +105 -0
  93. stadiamaps/models/route_response_trip.py +1 -1
  94. stadiamaps/models/route_summary.py +48 -30
  95. stadiamaps/models/route_trip.py +135 -0
  96. stadiamaps/models/routing_response_waypoint.py +49 -30
  97. stadiamaps/models/routing_response_waypoint_all_of.py +1 -1
  98. stadiamaps/models/routing_waypoint.py +60 -41
  99. stadiamaps/models/routing_waypoint_all_of.py +1 -1
  100. stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
  101. stadiamaps/models/simple_routing_waypoint.py +48 -29
  102. stadiamaps/models/simple_routing_waypoint_all_of.py +1 -1
  103. stadiamaps/models/speeds.py +49 -31
  104. stadiamaps/models/trace_attribute_filter_options.py +47 -28
  105. stadiamaps/models/trace_attribute_key.py +8 -11
  106. stadiamaps/models/trace_attributes_base_response.py +51 -32
  107. stadiamaps/models/trace_attributes_request.py +72 -42
  108. stadiamaps/models/trace_attributes_request_all_of.py +1 -1
  109. stadiamaps/models/trace_attributes_request_all_of_filters.py +2 -2
  110. stadiamaps/models/trace_attributes_response.py +54 -35
  111. stadiamaps/models/trace_attributes_response_all_of.py +1 -1
  112. stadiamaps/models/trace_edge.py +88 -70
  113. stadiamaps/models/travel_mode.py +8 -11
  114. stadiamaps/models/traversability.py +8 -11
  115. stadiamaps/models/truck_costing_options.py +72 -51
  116. stadiamaps/models/truck_costing_options_all_of.py +1 -1
  117. stadiamaps/models/tz_response.py +45 -27
  118. stadiamaps/models/valhalla_languages.py +8 -11
  119. stadiamaps/models/valhalla_long_units.py +8 -11
  120. stadiamaps/models/warning.py +42 -24
  121. stadiamaps/py.typed +0 -0
  122. stadiamaps/rest.py +127 -172
  123. {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/METADATA +4 -4
  124. stadiamaps-2.0.0.dist-info/RECORD +128 -0
  125. {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/WHEEL +1 -1
  126. stadiamaps-1.0.6.dist-info/RECORD +0 -125
  127. {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/LICENSE.txt +0 -0
  128. {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. # noqa: E501
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: 5.0.5
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,56 +18,74 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
-
22
- from typing import List, Optional, Union
23
- from pydantic import BaseModel, Field, StrictInt, StrictStr, confloat, conint, conlist
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_attributes_base_response import TraceAttributesBaseResponse
27
27
  from stadiamaps.models.trace_edge import TraceEdge
28
28
  from stadiamaps.models.valhalla_long_units import ValhallaLongUnits
29
+ from typing import Optional, Set
30
+ from typing_extensions import Self
29
31
 
30
32
  class TraceAttributesResponse(BaseModel):
31
33
  """
32
34
  TraceAttributesResponse
33
- """
34
- edges: Optional[conlist(TraceEdge)] = Field(None, description="The list of edges matched along the path.")
35
- admins: Optional[conlist(AdminRegion)] = Field(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[conlist(MatchedPoint)] = Field(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
+ """ # noqa: E501
36
+ edges: Optional[List[TraceEdge]] = Field(default=None, description="The list of edges matched along the path.")
37
+ 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.")
38
+ 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.")
37
39
  osm_changeset: Optional[StrictInt] = None
38
- shape: Optional[StrictStr] = Field(None, description="The encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) of the matched path.")
39
- confidence_score: Optional[Union[confloat(le=1, ge=0, strict=True), conint(le=1, ge=0, strict=True)]] = None
40
- id: Optional[StrictStr] = Field(None, description="An identifier to disambiguate requests (echoed by the server).")
40
+ shape: Optional[StrictStr] = Field(default=None, description="The encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) of the matched path.")
41
+ confidence_score: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = None
42
+ id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
41
43
  units: Optional[ValhallaLongUnits] = None
42
- alternate_paths: Optional[conlist(TraceAttributesBaseResponse)] = Field(None, description="Alternate paths, if any, that were not classified as the best match.")
44
+ alternate_paths: Optional[List[TraceAttributesBaseResponse]] = Field(default=None, description="Alternate paths, if any, that were not classified as the best match.")
43
45
  additional_properties: Dict[str, Any] = {}
44
- __properties = ["edges", "admins", "matched_points", "osm_changeset", "shape", "confidence_score", "id", "units", "alternate_paths"]
46
+ __properties: ClassVar[List[str]] = ["edges", "admins", "matched_points", "osm_changeset", "shape", "confidence_score", "id", "units", "alternate_paths"]
47
+
48
+ model_config = ConfigDict(
49
+ populate_by_name=True,
50
+ validate_assignment=True,
51
+ protected_namespaces=(),
52
+ )
45
53
 
46
- class Config:
47
- """Pydantic configuration"""
48
- allow_population_by_field_name = True
49
- validate_assignment = True
50
54
 
51
55
  def to_str(self) -> str:
52
56
  """Returns the string representation of the model using alias"""
53
- return pprint.pformat(self.dict(by_alias=True))
57
+ return pprint.pformat(self.model_dump(by_alias=True))
54
58
 
55
59
  def to_json(self) -> str:
56
60
  """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
62
  return json.dumps(self.to_dict())
58
63
 
59
64
  @classmethod
60
- def from_json(cls, json_str: str) -> TraceAttributesResponse:
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
66
  """Create an instance of TraceAttributesResponse from a JSON string"""
62
67
  return cls.from_dict(json.loads(json_str))
63
68
 
64
- def to_dict(self):
65
- """Returns the dictionary representation of the model using alias"""
66
- _dict = self.dict(by_alias=True,
67
- exclude={
68
- "additional_properties"
69
- },
70
- exclude_none=True)
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ * Fields in `self.additional_properties` are added to the output dict.
79
+ """
80
+ excluded_fields: Set[str] = set([
81
+ "additional_properties",
82
+ ])
83
+
84
+ _dict = self.model_dump(
85
+ by_alias=True,
86
+ exclude=excluded_fields,
87
+ exclude_none=True,
88
+ )
71
89
  # override the default output from pydantic by calling `to_dict()` of each item in edges (list)
72
90
  _items = []
73
91
  if self.edges:
@@ -104,24 +122,24 @@ class TraceAttributesResponse(BaseModel):
104
122
  return _dict
105
123
 
106
124
  @classmethod
107
- def from_dict(cls, obj: dict) -> TraceAttributesResponse:
125
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108
126
  """Create an instance of TraceAttributesResponse from a dict"""
109
127
  if obj is None:
110
128
  return None
111
129
 
112
130
  if not isinstance(obj, dict):
113
- return TraceAttributesResponse.parse_obj(obj)
131
+ return cls.model_validate(obj)
114
132
 
115
- _obj = TraceAttributesResponse.parse_obj({
116
- "edges": [TraceEdge.from_dict(_item) for _item in obj.get("edges")] if obj.get("edges") is not None else None,
117
- "admins": [AdminRegion.from_dict(_item) for _item in obj.get("admins")] if obj.get("admins") is not None else None,
118
- "matched_points": [MatchedPoint.from_dict(_item) for _item in obj.get("matched_points")] if obj.get("matched_points") is not None else None,
133
+ _obj = cls.model_validate({
134
+ "edges": [TraceEdge.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None,
135
+ "admins": [AdminRegion.from_dict(_item) for _item in obj["admins"]] if obj.get("admins") is not None else None,
136
+ "matched_points": [MatchedPoint.from_dict(_item) for _item in obj["matched_points"]] if obj.get("matched_points") is not None else None,
119
137
  "osm_changeset": obj.get("osm_changeset"),
120
138
  "shape": obj.get("shape"),
121
139
  "confidence_score": obj.get("confidence_score"),
122
140
  "id": obj.get("id"),
123
141
  "units": obj.get("units"),
124
- "alternate_paths": [TraceAttributesBaseResponse.from_dict(_item) for _item in obj.get("alternate_paths")] if obj.get("alternate_paths") is not None else None
142
+ "alternate_paths": [TraceAttributesBaseResponse.from_dict(_item) for _item in obj["alternate_paths"]] if obj.get("alternate_paths") is not None else None
125
143
  })
126
144
  # store additional fields in additional_properties
127
145
  for _key in obj.keys():
@@ -130,3 +148,4 @@ class TraceAttributesResponse(BaseModel):
130
148
 
131
149
  return _obj
132
150
 
151
+
@@ -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.5
8
+ The version of the OpenAPI document: 5.0.6
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -3,14 +3,14 @@
3
3
  """
4
4
  Stadia Maps Geospatial APIs
5
5
 
6
- The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications. # noqa: E501
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: 5.0.5
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,38 +18,39 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
-
22
- from typing import Any, List, Optional, Union
23
- from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
23
  from stadiamaps.models.edge_sign import EdgeSign
25
24
  from stadiamaps.models.edge_use import EdgeUse
26
25
  from stadiamaps.models.end_node import EndNode
27
26
  from stadiamaps.models.road_class import RoadClass
28
27
  from stadiamaps.models.travel_mode import TravelMode
29
28
  from stadiamaps.models.traversability import Traversability
29
+ from typing import Optional, Set
30
+ from typing_extensions import Self
30
31
 
31
32
  class TraceEdge(BaseModel):
32
33
  """
33
34
  TraceEdge
34
- """
35
- names: Optional[conlist(StrictStr)] = Field(None, description="The name(s) of the road at this edge, if any.")
36
- length: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The length of this edge in `units`.")
37
- speed: Optional[StrictInt] = Field(None, description="The speed of this edge in `units`/hr, in terms of average/free-flow speed for routing purposes. This is affected by any number of factors such as the road service, vehicle type, etc. and not just the posted speed limits.")
35
+ """ # noqa: E501
36
+ names: Optional[List[StrictStr]] = Field(default=None, description="The name(s) of the road at this edge, if any.")
37
+ length: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The length of this edge in `units`.")
38
+ speed: Optional[StrictInt] = Field(default=None, description="The speed of this edge in `units`/hr, in terms of average/free-flow speed for routing purposes. This is affected by any number of factors such as the road service, vehicle type, etc. and not just the posted speed limits.")
38
39
  road_class: Optional[RoadClass] = None
39
- begin_heading: Optional[StrictInt] = Field(None, description="The direction at the beginning of an edge. The units are degrees clockwise from north.")
40
- end_heading: Optional[StrictInt] = Field(None, description="The direction at the end of an edge. The units are degrees clockwise from north.")
41
- begin_shape_index: Optional[StrictInt] = Field(None, description="Index into the list of shape points for the start of the edge.")
42
- end_shape_index: Optional[StrictInt] = Field(None, description="Index into the list of shape points for the end of the edge.")
40
+ begin_heading: Optional[StrictInt] = Field(default=None, description="The direction at the beginning of an edge. The units are degrees clockwise from north.")
41
+ end_heading: Optional[StrictInt] = Field(default=None, description="The direction at the end of an edge. The units are degrees clockwise from north.")
42
+ begin_shape_index: Optional[StrictInt] = Field(default=None, description="Index into the list of shape points for the start of the edge.")
43
+ end_shape_index: Optional[StrictInt] = Field(default=None, description="Index into the list of shape points for the end of the edge.")
43
44
  traversability: Optional[Traversability] = None
44
45
  use: Optional[EdgeUse] = None
45
- toll: Optional[StrictBool] = Field(None, description="True if the edge has a toll.")
46
- unpaved: Optional[StrictBool] = Field(None, description="True if the edge has rough payment.")
47
- tunnel: Optional[StrictBool] = Field(None, description="True if the edge has a tunnel.")
48
- bridge: Optional[StrictBool] = Field(None, description="True if the edge has a bridge.")
49
- roundabout: Optional[StrictBool] = Field(None, description="True if the edge has a roundabout.")
50
- internal_intersection: Optional[StrictBool] = Field(None, description="True if the edge has an internal intersection.")
51
- drive_on_right: Optional[StrictBool] = Field(None, description="True if the edge is in an area where you must drive on the right side of the road.")
52
- surface: Optional[StrictStr] = Field(None, description="The type of surface for the edge.")
46
+ toll: Optional[StrictBool] = Field(default=None, description="True if the edge has a toll.")
47
+ unpaved: Optional[StrictBool] = Field(default=None, description="True if the edge has rough payment.")
48
+ tunnel: Optional[StrictBool] = Field(default=None, description="True if the edge is a tunnel.")
49
+ bridge: Optional[StrictBool] = Field(default=None, description="True if the edge is a bridge.")
50
+ roundabout: Optional[StrictBool] = Field(default=None, description="True if the edge is a roundabout.")
51
+ internal_intersection: Optional[StrictBool] = Field(default=None, description="True if the edge is an internal intersection.")
52
+ drive_on_right: Optional[StrictBool] = Field(default=None, description="True if the edge is in an area where you must drive on the right side of the road.")
53
+ surface: Optional[StrictStr] = Field(default=None, description="The type of surface for the edge.")
53
54
  sign: Optional[EdgeSign] = None
54
55
  travel_mode: Optional[TravelMode] = None
55
56
  vehicle_type: Optional[StrictStr] = None
@@ -57,119 +58,135 @@ class TraceEdge(BaseModel):
57
58
  bicycle_type: Optional[StrictStr] = None
58
59
  transit_type: Optional[StrictStr] = None
59
60
  id: Optional[StrictInt] = None
60
- way_id: Optional[StrictInt] = Field(None, description="The way identifier of the edge in OSM.")
61
- weighted_grade: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The weighted grade factor. Valhalla manufactures a weighted grade from elevation data. It is a measure used for hill avoidance in routing - sort of a relative energy use along an edge. But since an edge in Valhalla can possibly go up and down over several hills it might not equate to what you would normally think of as grade.")
62
- max_upward_grade: Optional[StrictInt] = Field(None, description="The maximum upward slope. A value of 32768 indicates no elevation data is available for this edge.")
63
- max_downward_grade: Optional[StrictInt] = Field(None, description="The maximum downward slope. A value of 32768 indicates no elevation data is available for this edge.")
64
- mean_elevation: Optional[StrictInt] = Field(None, description="The mean elevation along the edge. Units are meters by default. If the `units` are specified as miles, then the mean elevation is returned in feet. A value of 32768 indicates no elevation data is available for this edge.")
65
- lane_count: Optional[StrictInt] = Field(None, description="The number of lanes for this edge.")
66
- cycle_lane: Optional[StrictStr] = Field(None, description="The type of cycle lane (if any) along this edge.")
67
- bicycle_network: Optional[StrictInt] = Field(None, description="The type of bicycle network, if any. This is an integer comprised of constants bitwise or'd together. For example, a route that's part of both a local and mountain network would have a value of 12. 1 - National 2 - Regional 4 - Local 8 - Mountain")
68
- sac_scale: Optional[StrictInt] = Field(None, description="The difficulty of the hiking trail according to the SAC scale. 0 - No Sac Scale 1 - Hiking 2 - Mountain hiking 3 - Demanding mountain hiking 4 - Alpine hiking 5 - Demanding alpine hiking 6 - Difficult alpine hiking")
61
+ way_id: Optional[StrictInt] = Field(default=None, description="The way identifier of the edge in OSM.")
62
+ weighted_grade: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The weighted grade factor. Valhalla manufactures a weighted grade from elevation data. It is a measure used for hill avoidance in routing - sort of a relative energy use along an edge. But since an edge in Valhalla can possibly go up and down over several hills it might not equate to what you would normally think of as grade.")
63
+ max_upward_grade: Optional[StrictInt] = Field(default=None, description="The maximum upward slope. A value of 32768 indicates no elevation data is available for this edge.")
64
+ max_downward_grade: Optional[StrictInt] = Field(default=None, description="The maximum downward slope. A value of 32768 indicates no elevation data is available for this edge.")
65
+ mean_elevation: Optional[StrictInt] = Field(default=None, description="The mean elevation along the edge. Units are meters by default. If the `units` are specified as miles, then the mean elevation is returned in feet. A value of 32768 indicates no elevation data is available for this edge.")
66
+ lane_count: Optional[StrictInt] = Field(default=None, description="The number of lanes for this edge.")
67
+ cycle_lane: Optional[StrictStr] = Field(default=None, description="The type of cycle lane (if any) along this edge.")
68
+ bicycle_network: Optional[StrictInt] = Field(default=None, description="The type of bicycle network, if any. This is an integer comprised of constants bitwise or'd together. For example, a route that's part of both a local and mountain network would have a value of 12. 1 - National 2 - Regional 4 - Local 8 - Mountain")
69
+ sac_scale: Optional[StrictInt] = Field(default=None, description="The difficulty of the hiking trail according to the SAC scale. 0 - No Sac Scale 1 - Hiking 2 - Mountain hiking 3 - Demanding mountain hiking 4 - Alpine hiking 5 - Demanding alpine hiking 6 - Difficult alpine hiking")
69
70
  sidewalk: Optional[StrictStr] = None
70
71
  density: Optional[StrictInt] = None
71
- speed_limit: Optional[Any] = Field(None, description="The speed limit along the edge measured in `units`/hr. This may be either an integer or the string \"unlimited\" if speed limit data is available. If absent, there is no speed limit data available.")
72
- truck_speed: Optional[StrictInt] = Field(None, description="The truck speed of this edge in `units`/hr, in terms of average/free-flow speed for routing purposes. This is affected by any number of factors such as the road service, vehicle type, etc. and not just the posted speed limits.")
73
- truck_route: Optional[StrictBool] = Field(None, description="True if the edge is part of a truck route/network.")
72
+ speed_limit: Optional[Any] = Field(default=None, description="The speed limit along the edge measured in `units`/hr. This may be either an integer or the string \"unlimited\" if speed limit data is available. If absent, there is no speed limit data available.")
73
+ truck_speed: Optional[StrictInt] = Field(default=None, description="The truck speed of this edge in `units`/hr, in terms of average/free-flow speed for routing purposes. This is affected by any number of factors such as the road service, vehicle type, etc. and not just the posted speed limits.")
74
+ truck_route: Optional[StrictBool] = Field(default=None, description="True if the edge is part of a truck route/network.")
74
75
  end_node: Optional[EndNode] = None
75
76
  additional_properties: Dict[str, Any] = {}
76
- __properties = ["names", "length", "speed", "road_class", "begin_heading", "end_heading", "begin_shape_index", "end_shape_index", "traversability", "use", "toll", "unpaved", "tunnel", "bridge", "roundabout", "internal_intersection", "drive_on_right", "surface", "sign", "travel_mode", "vehicle_type", "pedestrian_type", "bicycle_type", "transit_type", "id", "way_id", "weighted_grade", "max_upward_grade", "max_downward_grade", "mean_elevation", "lane_count", "cycle_lane", "bicycle_network", "sac_scale", "sidewalk", "density", "speed_limit", "truck_speed", "truck_route", "end_node"]
77
+ __properties: ClassVar[List[str]] = ["names", "length", "speed", "road_class", "begin_heading", "end_heading", "begin_shape_index", "end_shape_index", "traversability", "use", "toll", "unpaved", "tunnel", "bridge", "roundabout", "internal_intersection", "drive_on_right", "surface", "sign", "travel_mode", "vehicle_type", "pedestrian_type", "bicycle_type", "transit_type", "id", "way_id", "weighted_grade", "max_upward_grade", "max_downward_grade", "mean_elevation", "lane_count", "cycle_lane", "bicycle_network", "sac_scale", "sidewalk", "density", "speed_limit", "truck_speed", "truck_route", "end_node"]
77
78
 
78
- @validator('surface')
79
+ @field_validator('surface')
79
80
  def surface_validate_enum(cls, value):
80
81
  """Validates the enum"""
81
82
  if value is None:
82
83
  return value
83
84
 
84
- if value not in ('paved_smooth', 'paved', 'paved_rough', 'compacted', 'dirt', 'gravel', 'path', 'impassable'):
85
+ if value not in set(['paved_smooth', 'paved', 'paved_rough', 'compacted', 'dirt', 'gravel', 'path', 'impassable']):
85
86
  raise ValueError("must be one of enum values ('paved_smooth', 'paved', 'paved_rough', 'compacted', 'dirt', 'gravel', 'path', 'impassable')")
86
87
  return value
87
88
 
88
- @validator('vehicle_type')
89
+ @field_validator('vehicle_type')
89
90
  def vehicle_type_validate_enum(cls, value):
90
91
  """Validates the enum"""
91
92
  if value is None:
92
93
  return value
93
94
 
94
- if value not in ('car', 'motorcycle', 'bus', 'tractor_trailer'):
95
- raise ValueError("must be one of enum values ('car', 'motorcycle', 'bus', 'tractor_trailer')")
95
+ if value not in set(['car', 'motorcycle', 'bus', 'tractor_trailer', 'golf_cart', 'low_speed_vehicle']):
96
+ raise ValueError("must be one of enum values ('car', 'motorcycle', 'bus', 'tractor_trailer', 'golf_cart', 'low_speed_vehicle')")
96
97
  return value
97
98
 
98
- @validator('pedestrian_type')
99
+ @field_validator('pedestrian_type')
99
100
  def pedestrian_type_validate_enum(cls, value):
100
101
  """Validates the enum"""
101
102
  if value is None:
102
103
  return value
103
104
 
104
- if value not in ('foot', 'wheelchair', 'segway'):
105
+ if value not in set(['foot', 'wheelchair', 'segway']):
105
106
  raise ValueError("must be one of enum values ('foot', 'wheelchair', 'segway')")
106
107
  return value
107
108
 
108
- @validator('bicycle_type')
109
+ @field_validator('bicycle_type')
109
110
  def bicycle_type_validate_enum(cls, value):
110
111
  """Validates the enum"""
111
112
  if value is None:
112
113
  return value
113
114
 
114
- if value not in ('road', 'cross', 'hybrid', 'mountain'):
115
+ if value not in set(['road', 'cross', 'hybrid', 'mountain']):
115
116
  raise ValueError("must be one of enum values ('road', 'cross', 'hybrid', 'mountain')")
116
117
  return value
117
118
 
118
- @validator('transit_type')
119
+ @field_validator('transit_type')
119
120
  def transit_type_validate_enum(cls, value):
120
121
  """Validates the enum"""
121
122
  if value is None:
122
123
  return value
123
124
 
124
- if value not in ('tram', 'metro', 'rail', 'bus', 'ferry', 'cable_car', 'gondola', 'funicular'):
125
+ if value not in set(['tram', 'metro', 'rail', 'bus', 'ferry', 'cable_car', 'gondola', 'funicular']):
125
126
  raise ValueError("must be one of enum values ('tram', 'metro', 'rail', 'bus', 'ferry', 'cable_car', 'gondola', 'funicular')")
126
127
  return value
127
128
 
128
- @validator('cycle_lane')
129
+ @field_validator('cycle_lane')
129
130
  def cycle_lane_validate_enum(cls, value):
130
131
  """Validates the enum"""
131
132
  if value is None:
132
133
  return value
133
134
 
134
- if value not in ('none', 'shared', 'dedicated', 'separated'):
135
+ if value not in set(['none', 'shared', 'dedicated', 'separated']):
135
136
  raise ValueError("must be one of enum values ('none', 'shared', 'dedicated', 'separated')")
136
137
  return value
137
138
 
138
- @validator('sidewalk')
139
+ @field_validator('sidewalk')
139
140
  def sidewalk_validate_enum(cls, value):
140
141
  """Validates the enum"""
141
142
  if value is None:
142
143
  return value
143
144
 
144
- if value not in ('left', 'right', 'both', 'none'):
145
+ if value not in set(['left', 'right', 'both', 'none']):
145
146
  raise ValueError("must be one of enum values ('left', 'right', 'both', 'none')")
146
147
  return value
147
148
 
148
- class Config:
149
- """Pydantic configuration"""
150
- allow_population_by_field_name = True
151
- validate_assignment = True
149
+ model_config = ConfigDict(
150
+ populate_by_name=True,
151
+ validate_assignment=True,
152
+ protected_namespaces=(),
153
+ )
154
+
152
155
 
153
156
  def to_str(self) -> str:
154
157
  """Returns the string representation of the model using alias"""
155
- return pprint.pformat(self.dict(by_alias=True))
158
+ return pprint.pformat(self.model_dump(by_alias=True))
156
159
 
157
160
  def to_json(self) -> str:
158
161
  """Returns the JSON representation of the model using alias"""
162
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
159
163
  return json.dumps(self.to_dict())
160
164
 
161
165
  @classmethod
162
- def from_json(cls, json_str: str) -> TraceEdge:
166
+ def from_json(cls, json_str: str) -> Optional[Self]:
163
167
  """Create an instance of TraceEdge from a JSON string"""
164
168
  return cls.from_dict(json.loads(json_str))
165
169
 
166
- def to_dict(self):
167
- """Returns the dictionary representation of the model using alias"""
168
- _dict = self.dict(by_alias=True,
169
- exclude={
170
- "additional_properties"
171
- },
172
- exclude_none=True)
170
+ def to_dict(self) -> Dict[str, Any]:
171
+ """Return the dictionary representation of the model using alias.
172
+
173
+ This has the following differences from calling pydantic's
174
+ `self.model_dump(by_alias=True)`:
175
+
176
+ * `None` is only added to the output dict for nullable fields that
177
+ were set at model initialization. Other fields with value `None`
178
+ are ignored.
179
+ * Fields in `self.additional_properties` are added to the output dict.
180
+ """
181
+ excluded_fields: Set[str] = set([
182
+ "additional_properties",
183
+ ])
184
+
185
+ _dict = self.model_dump(
186
+ by_alias=True,
187
+ exclude=excluded_fields,
188
+ exclude_none=True,
189
+ )
173
190
  # override the default output from pydantic by calling `to_dict()` of sign
174
191
  if self.sign:
175
192
  _dict['sign'] = self.sign.to_dict()
@@ -182,22 +199,22 @@ class TraceEdge(BaseModel):
182
199
  _dict[_key] = _value
183
200
 
184
201
  # set to None if speed_limit (nullable) is None
185
- # and __fields_set__ contains the field
186
- if self.speed_limit is None and "speed_limit" in self.__fields_set__:
202
+ # and model_fields_set contains the field
203
+ if self.speed_limit is None and "speed_limit" in self.model_fields_set:
187
204
  _dict['speed_limit'] = None
188
205
 
189
206
  return _dict
190
207
 
191
208
  @classmethod
192
- def from_dict(cls, obj: dict) -> TraceEdge:
209
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
193
210
  """Create an instance of TraceEdge from a dict"""
194
211
  if obj is None:
195
212
  return None
196
213
 
197
214
  if not isinstance(obj, dict):
198
- return TraceEdge.parse_obj(obj)
215
+ return cls.model_validate(obj)
199
216
 
200
- _obj = TraceEdge.parse_obj({
217
+ _obj = cls.model_validate({
201
218
  "names": obj.get("names"),
202
219
  "length": obj.get("length"),
203
220
  "speed": obj.get("speed"),
@@ -216,7 +233,7 @@ class TraceEdge(BaseModel):
216
233
  "internal_intersection": obj.get("internal_intersection"),
217
234
  "drive_on_right": obj.get("drive_on_right"),
218
235
  "surface": obj.get("surface"),
219
- "sign": EdgeSign.from_dict(obj.get("sign")) if obj.get("sign") is not None else None,
236
+ "sign": EdgeSign.from_dict(obj["sign"]) if obj.get("sign") is not None else None,
220
237
  "travel_mode": obj.get("travel_mode"),
221
238
  "vehicle_type": obj.get("vehicle_type"),
222
239
  "pedestrian_type": obj.get("pedestrian_type"),
@@ -237,7 +254,7 @@ class TraceEdge(BaseModel):
237
254
  "speed_limit": obj.get("speed_limit"),
238
255
  "truck_speed": obj.get("truck_speed"),
239
256
  "truck_route": obj.get("truck_route"),
240
- "end_node": EndNode.from_dict(obj.get("end_node")) if obj.get("end_node") is not None else None
257
+ "end_node": EndNode.from_dict(obj["end_node"]) if obj.get("end_node") is not None else None
241
258
  })
242
259
  # store additional fields in additional_properties
243
260
  for _key in obj.keys():
@@ -246,3 +263,4 @@ class TraceEdge(BaseModel):
246
263
 
247
264
  return _obj
248
265
 
266
+
@@ -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. # noqa: E501
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: 5.0.5
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 pprint
18
- import re # noqa: F401
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 TravelMode(str, Enum):
@@ -36,8 +33,8 @@ class TravelMode(str, Enum):
36
33
  TRANSIT = 'transit'
37
34
 
38
35
  @classmethod
39
- def from_json(cls, json_str: str) -> TravelMode:
36
+ def from_json(cls, json_str: str) -> Self:
40
37
  """Create an instance of TravelMode from a JSON string"""
41
- return TravelMode(json.loads(json_str))
38
+ return cls(json.loads(json_str))
42
39
 
43
40
 
@@ -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. # noqa: E501
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: 5.0.5
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 pprint
18
- import re # noqa: F401
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 Traversability(str, Enum):
@@ -35,8 +32,8 @@ class Traversability(str, Enum):
35
32
  BOTH = 'both'
36
33
 
37
34
  @classmethod
38
- def from_json(cls, json_str: str) -> Traversability:
35
+ def from_json(cls, json_str: str) -> Self:
39
36
  """Create an instance of Traversability from a JSON string"""
40
- return Traversability(json.loads(json_str))
37
+ return cls(json.loads(json_str))
41
38
 
42
39