stadiamaps 1.0.7__py3-none-any.whl → 2.1.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 (112) 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 +75 -48
  14. stadiamaps/models/base_costing_options.py +59 -34
  15. stadiamaps/models/base_trace_request.py +70 -40
  16. stadiamaps/models/bicycle_costing_options.py +67 -42
  17. stadiamaps/models/bike_network.py +42 -24
  18. stadiamaps/models/contour.py +45 -27
  19. stadiamaps/models/coordinate.py +45 -26
  20. stadiamaps/models/costing_model.py +10 -12
  21. stadiamaps/models/costing_options.py +51 -33
  22. stadiamaps/models/directions_options.py +45 -27
  23. stadiamaps/models/distance_unit.py +8 -11
  24. stadiamaps/models/edge_sign.py +46 -28
  25. stadiamaps/models/edge_use.py +8 -11
  26. stadiamaps/models/end_node.py +48 -30
  27. stadiamaps/models/geo_attributes.py +47 -29
  28. stadiamaps/models/geo_json_geometry.py +25 -25
  29. stadiamaps/models/geo_json_geometry_base.py +45 -27
  30. stadiamaps/models/geo_json_line_string.py +47 -28
  31. stadiamaps/models/geo_json_line_string_all_of.py +1 -1
  32. stadiamaps/models/geo_json_point.py +47 -28
  33. stadiamaps/models/geo_json_point_all_of.py +1 -1
  34. stadiamaps/models/geo_json_polygon.py +47 -28
  35. stadiamaps/models/geo_json_polygon_all_of.py +1 -1
  36. stadiamaps/models/geocoding_object.py +46 -28
  37. stadiamaps/models/height_request.py +55 -34
  38. stadiamaps/models/height_response.py +49 -30
  39. stadiamaps/models/highway_classification.py +52 -34
  40. stadiamaps/models/intersecting_edge.py +45 -27
  41. stadiamaps/models/isochrone_costing_model.py +8 -11
  42. stadiamaps/models/isochrone_feature.py +45 -27
  43. stadiamaps/models/isochrone_properties.py +48 -30
  44. stadiamaps/models/isochrone_request.py +54 -35
  45. stadiamaps/models/isochrone_response.py +47 -29
  46. stadiamaps/models/locate_detailed_edge.py +73 -55
  47. stadiamaps/models/locate_edge.py +56 -39
  48. stadiamaps/models/locate_edge_info.py +47 -29
  49. stadiamaps/models/locate_node.py +50 -31
  50. stadiamaps/models/locate_object.py +49 -31
  51. stadiamaps/models/maneuver_sign.py +50 -32
  52. stadiamaps/models/maneuver_sign_element.py +45 -27
  53. stadiamaps/models/map_match_costing_model.py +8 -11
  54. stadiamaps/models/map_match_request.py +74 -44
  55. stadiamaps/models/map_match_route_response.py +57 -29
  56. stadiamaps/models/map_match_trace_options.py +47 -29
  57. stadiamaps/models/map_match_waypoint.py +49 -30
  58. stadiamaps/models/matched_point.py +52 -34
  59. stadiamaps/models/matrix_costing_model.py +9 -12
  60. stadiamaps/models/matrix_distance.py +46 -28
  61. stadiamaps/models/matrix_request.py +70 -39
  62. stadiamaps/models/matrix_response.py +60 -36
  63. stadiamaps/models/motor_scooter_costing_options.py +76 -49
  64. stadiamaps/models/motorcycle_costing_options.py +75 -48
  65. stadiamaps/models/nearest_roads_request.py +65 -34
  66. stadiamaps/models/node_id.py +42 -24
  67. stadiamaps/models/node_type.py +8 -11
  68. stadiamaps/models/optimized_route_request.py +66 -35
  69. stadiamaps/models/pedestrian_costing_options.py +59 -40
  70. stadiamaps/models/pelias_geo_json_feature.py +50 -31
  71. stadiamaps/models/pelias_geo_json_properties.py +54 -36
  72. stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
  73. stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
  74. stadiamaps/models/pelias_layer.py +8 -11
  75. stadiamaps/models/pelias_response.py +49 -30
  76. stadiamaps/models/pelias_source.py +8 -11
  77. stadiamaps/models/restrictions.py +44 -26
  78. stadiamaps/models/road_class.py +8 -11
  79. stadiamaps/models/route_leg.py +48 -29
  80. stadiamaps/models/route_maneuver.py +73 -55
  81. stadiamaps/models/route_request.py +76 -43
  82. stadiamaps/models/route_response.py +56 -28
  83. stadiamaps/models/route_response_alternates_inner.py +105 -0
  84. stadiamaps/models/route_summary.py +48 -30
  85. stadiamaps/models/route_trip.py +135 -0
  86. stadiamaps/models/routing_response_waypoint.py +49 -30
  87. stadiamaps/models/routing_waypoint.py +60 -41
  88. stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
  89. stadiamaps/models/simple_routing_waypoint.py +48 -29
  90. stadiamaps/models/speeds.py +49 -31
  91. stadiamaps/models/trace_attribute_filter_options.py +47 -28
  92. stadiamaps/models/trace_attribute_key.py +8 -11
  93. stadiamaps/models/trace_attributes_base_response.py +51 -32
  94. stadiamaps/models/trace_attributes_request.py +72 -42
  95. stadiamaps/models/trace_attributes_request_all_of_filters.py +1 -1
  96. stadiamaps/models/trace_attributes_response.py +54 -35
  97. stadiamaps/models/trace_edge.py +88 -70
  98. stadiamaps/models/travel_mode.py +8 -11
  99. stadiamaps/models/traversability.py +8 -11
  100. stadiamaps/models/truck_costing_options.py +78 -51
  101. stadiamaps/models/tz_response.py +45 -27
  102. stadiamaps/models/valhalla_languages.py +8 -11
  103. stadiamaps/models/valhalla_long_units.py +8 -11
  104. stadiamaps/models/warning.py +42 -24
  105. stadiamaps/py.typed +0 -0
  106. stadiamaps/rest.py +127 -172
  107. {stadiamaps-1.0.7.dist-info → stadiamaps-2.1.0.dist-info}/METADATA +4 -4
  108. stadiamaps-2.1.0.dist-info/RECORD +128 -0
  109. {stadiamaps-1.0.7.dist-info → stadiamaps-2.1.0.dist-info}/WHEEL +1 -1
  110. stadiamaps-1.0.7.dist-info/RECORD +0 -125
  111. {stadiamaps-1.0.7.dist-info → stadiamaps-2.1.0.dist-info}/LICENSE.txt +0 -0
  112. {stadiamaps-1.0.7.dist-info → stadiamaps-2.1.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.6
8
+ The version of the OpenAPI document: 6.1.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,59 +18,78 @@ 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, StrictBool, StrictStr, conint, conlist, validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
24
  from stadiamaps.models.coordinate import Coordinate
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
25
27
 
26
28
  class HeightRequest(BaseModel):
27
29
  """
28
30
  HeightRequest
29
- """
30
- id: Optional[StrictStr] = Field(None, description="An identifier to disambiguate requests (echoed by the server).")
31
- shape: Optional[conlist(Coordinate)] = Field(None, description="REQUIRED if `encoded_polyline` is not present.")
32
- encoded_polyline: Optional[StrictStr] = Field(None, description="REQUIRED if `shape` is not present. An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm).")
33
- shape_format: Optional[StrictStr] = Field('polyline6', description="Specifies whether the polyline is encoded with 6 digit precision (polyline6) or 5 digit precision (polyline5).")
34
- range: Optional[StrictBool] = Field(False, description="Controls whether or not the returned array is one-dimensional (height only) or two-dimensional (with a range and height). The range dimension can be used to generate a graph or steepness gradient along a route.")
35
- height_precision: Optional[conint(strict=True, le=2, ge=0)] = Field(0, description="The decimal precision (number of digits after the point) of the output. When 0, integer values are returned. Valid values are 0, 1, and 2.")
31
+ """ # noqa: E501
32
+ id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
33
+ shape: Optional[List[Coordinate]] = Field(default=None, description="REQUIRED if `encoded_polyline` is not present.")
34
+ 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).")
35
+ shape_format: Optional[StrictStr] = Field(default='polyline6', description="Specifies whether the polyline is encoded with 6 digit precision (polyline6) or 5 digit precision (polyline5).")
36
+ range: Optional[StrictBool] = Field(default=False, description="Controls whether or not the returned array is one-dimensional (height only) or two-dimensional (with a range and height). The range dimension can be used to generate a graph or steepness gradient along a route.")
37
+ height_precision: Optional[Annotated[int, Field(le=2, strict=True, ge=0)]] = Field(default=0, description="The decimal precision (number of digits after the point) of the output. When 0, integer values are returned. Valid values are 0, 1, and 2.")
38
+ resample_distance: Optional[Annotated[int, Field(strict=True, ge=10)]] = Field(default=None, description="The distance at which the input polyline should be sampled to provide uniform distances between points. If not set, the input shape will be used as-is.")
36
39
  additional_properties: Dict[str, Any] = {}
37
- __properties = ["id", "shape", "encoded_polyline", "shape_format", "range", "height_precision"]
40
+ __properties: ClassVar[List[str]] = ["id", "shape", "encoded_polyline", "shape_format", "range", "height_precision", "resample_distance"]
38
41
 
39
- @validator('shape_format')
42
+ @field_validator('shape_format')
40
43
  def shape_format_validate_enum(cls, value):
41
44
  """Validates the enum"""
42
45
  if value is None:
43
46
  return value
44
47
 
45
- if value not in ('polyline6', 'polyline5'):
48
+ if value not in set(['polyline6', 'polyline5']):
46
49
  raise ValueError("must be one of enum values ('polyline6', 'polyline5')")
47
50
  return value
48
51
 
49
- class Config:
50
- """Pydantic configuration"""
51
- allow_population_by_field_name = True
52
- validate_assignment = True
52
+ model_config = ConfigDict(
53
+ populate_by_name=True,
54
+ validate_assignment=True,
55
+ protected_namespaces=(),
56
+ )
57
+
53
58
 
54
59
  def to_str(self) -> str:
55
60
  """Returns the string representation of the model using alias"""
56
- return pprint.pformat(self.dict(by_alias=True))
61
+ return pprint.pformat(self.model_dump(by_alias=True))
57
62
 
58
63
  def to_json(self) -> str:
59
64
  """Returns the JSON representation of the model using alias"""
65
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
66
  return json.dumps(self.to_dict())
61
67
 
62
68
  @classmethod
63
- def from_json(cls, json_str: str) -> HeightRequest:
69
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
70
  """Create an instance of HeightRequest from a JSON string"""
65
71
  return cls.from_dict(json.loads(json_str))
66
72
 
67
- def to_dict(self):
68
- """Returns the dictionary representation of the model using alias"""
69
- _dict = self.dict(by_alias=True,
70
- exclude={
71
- "additional_properties"
72
- },
73
- exclude_none=True)
73
+ def to_dict(self) -> Dict[str, Any]:
74
+ """Return the dictionary representation of the model using alias.
75
+
76
+ This has the following differences from calling pydantic's
77
+ `self.model_dump(by_alias=True)`:
78
+
79
+ * `None` is only added to the output dict for nullable fields that
80
+ were set at model initialization. Other fields with value `None`
81
+ are ignored.
82
+ * Fields in `self.additional_properties` are added to the output dict.
83
+ """
84
+ excluded_fields: Set[str] = set([
85
+ "additional_properties",
86
+ ])
87
+
88
+ _dict = self.model_dump(
89
+ by_alias=True,
90
+ exclude=excluded_fields,
91
+ exclude_none=True,
92
+ )
74
93
  # override the default output from pydantic by calling `to_dict()` of each item in shape (list)
75
94
  _items = []
76
95
  if self.shape:
@@ -86,21 +105,22 @@ class HeightRequest(BaseModel):
86
105
  return _dict
87
106
 
88
107
  @classmethod
89
- def from_dict(cls, obj: dict) -> HeightRequest:
108
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
109
  """Create an instance of HeightRequest from a dict"""
91
110
  if obj is None:
92
111
  return None
93
112
 
94
113
  if not isinstance(obj, dict):
95
- return HeightRequest.parse_obj(obj)
114
+ return cls.model_validate(obj)
96
115
 
97
- _obj = HeightRequest.parse_obj({
116
+ _obj = cls.model_validate({
98
117
  "id": obj.get("id"),
99
- "shape": [Coordinate.from_dict(_item) for _item in obj.get("shape")] if obj.get("shape") is not None else None,
118
+ "shape": [Coordinate.from_dict(_item) for _item in obj["shape"]] if obj.get("shape") is not None else None,
100
119
  "encoded_polyline": obj.get("encoded_polyline"),
101
120
  "shape_format": obj.get("shape_format") if obj.get("shape_format") is not None else 'polyline6',
102
121
  "range": obj.get("range") if obj.get("range") is not None else False,
103
- "height_precision": obj.get("height_precision") if obj.get("height_precision") is not None else 0
122
+ "height_precision": obj.get("height_precision") if obj.get("height_precision") is not None else 0,
123
+ "resample_distance": obj.get("resample_distance")
104
124
  })
105
125
  # store additional fields in additional_properties
106
126
  for _key in obj.keys():
@@ -109,3 +129,4 @@ class HeightRequest(BaseModel):
109
129
 
110
130
  return _obj
111
131
 
132
+
@@ -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.6
8
+ The version of the OpenAPI document: 6.1.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,48 +18,66 @@ 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, StrictInt, StrictStr, conlist
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing_extensions import Annotated
24
24
  from stadiamaps.models.coordinate import Coordinate
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
25
27
 
26
28
  class HeightResponse(BaseModel):
27
29
  """
28
30
  HeightResponse
29
- """
30
- id: Optional[StrictStr] = Field(None, description="An identifier to disambiguate requests (echoed by the server).")
31
- shape: Optional[conlist(Coordinate)] = None
32
- encoded_polyline: Optional[StrictStr] = Field(None, description="The input polyline.")
33
- height: Optional[conlist(StrictInt)] = Field(None, description="The list of heights for each point, in meters. Present only if `range` is `false`. Null values indicate missing data.")
34
- range_height: Optional[conlist(conlist(StrictInt))] = Field(None, description="The list of ranges and heights for each point in the shape, where each entry is an array of length 2. Present only if `range` is `true`. In each pair, the first element represents the range or distance along the input locations. It is the cumulative distance along the previous coordinates in the shape up to the current coordinate. This value for the first coordinate in the shape will always be 0. The second element in the pair represents the height or elevation at the associated coordinate. The height is null if no height data exists for a given location. Both values are expressed in meters.")
31
+ """ # noqa: E501
32
+ id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
33
+ shape: Optional[List[Coordinate]] = None
34
+ encoded_polyline: Optional[StrictStr] = Field(default=None, description="The input polyline.")
35
+ height: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="The list of heights for each point, in meters. Present only if `range` is `false`. Null values indicate missing data.")
36
+ range_height: Optional[List[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=2)]]] = Field(default=None, description="The list of ranges and heights for each point in the shape, where each entry is an array of length 2. Present only if `range` is `true`. In each pair, the first element represents the range or distance along the input locations. It is the cumulative distance along the previous coordinates in the shape up to the current coordinate. This value for the first coordinate in the shape will always be 0. The second element in the pair represents the height or elevation at the associated coordinate. The height is null if no height data exists for a given location. Both values are expressed in meters.")
35
37
  additional_properties: Dict[str, Any] = {}
36
- __properties = ["id", "shape", "encoded_polyline", "height", "range_height"]
38
+ __properties: ClassVar[List[str]] = ["id", "shape", "encoded_polyline", "height", "range_height"]
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
37
45
 
38
- class Config:
39
- """Pydantic configuration"""
40
- allow_population_by_field_name = True
41
- validate_assignment = True
42
46
 
43
47
  def to_str(self) -> str:
44
48
  """Returns the string representation of the model using alias"""
45
- return pprint.pformat(self.dict(by_alias=True))
49
+ return pprint.pformat(self.model_dump(by_alias=True))
46
50
 
47
51
  def to_json(self) -> str:
48
52
  """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
54
  return json.dumps(self.to_dict())
50
55
 
51
56
  @classmethod
52
- def from_json(cls, json_str: str) -> HeightResponse:
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
58
  """Create an instance of HeightResponse from a JSON string"""
54
59
  return cls.from_dict(json.loads(json_str))
55
60
 
56
- def to_dict(self):
57
- """Returns the dictionary representation of the model using alias"""
58
- _dict = self.dict(by_alias=True,
59
- exclude={
60
- "additional_properties"
61
- },
62
- exclude_none=True)
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ * Fields in `self.additional_properties` are added to the output dict.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ "additional_properties",
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
63
81
  # override the default output from pydantic by calling `to_dict()` of each item in shape (list)
64
82
  _items = []
65
83
  if self.shape:
@@ -75,17 +93,17 @@ class HeightResponse(BaseModel):
75
93
  return _dict
76
94
 
77
95
  @classmethod
78
- def from_dict(cls, obj: dict) -> HeightResponse:
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
97
  """Create an instance of HeightResponse from a dict"""
80
98
  if obj is None:
81
99
  return None
82
100
 
83
101
  if not isinstance(obj, dict):
84
- return HeightResponse.parse_obj(obj)
102
+ return cls.model_validate(obj)
85
103
 
86
- _obj = HeightResponse.parse_obj({
104
+ _obj = cls.model_validate({
87
105
  "id": obj.get("id"),
88
- "shape": [Coordinate.from_dict(_item) for _item in obj.get("shape")] if obj.get("shape") is not None else None,
106
+ "shape": [Coordinate.from_dict(_item) for _item in obj["shape"]] if obj.get("shape") is not None else None,
89
107
  "encoded_polyline": obj.get("encoded_polyline"),
90
108
  "height": obj.get("height"),
91
109
  "range_height": obj.get("range_height")
@@ -97,3 +115,4 @@ class HeightResponse(BaseModel):
97
115
 
98
116
  return _obj
99
117
 
118
+
@@ -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.6
8
+ The version of the OpenAPI document: 6.1.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,77 +18,94 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
-
22
- from typing import Optional
23
- from pydantic import BaseModel, Field, StrictBool, StrictStr, validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
24
25
 
25
26
  class HighwayClassification(BaseModel):
26
27
  """
27
28
  HighwayClassification
28
- """
29
- internal: Optional[StrictBool] = Field(None, description="Is the edge internal to an intersection?")
30
- link: Optional[StrictBool] = Field(None, description="Is the edge a ramp or turn channel?")
31
- surface: Optional[StrictStr] = Field(None, description="A representation of the smoothness of the highway. This is used for costing and access checks based on the vehicle type.")
29
+ """ # noqa: E501
30
+ internal: Optional[StrictBool] = Field(default=None, description="Is the edge internal to an intersection?")
31
+ link: Optional[StrictBool] = Field(default=None, description="Is the edge a ramp or turn channel?")
32
+ surface: Optional[StrictStr] = Field(default=None, description="A representation of the smoothness of the highway. This is used for costing and access checks based on the vehicle type.")
32
33
  use: Optional[StrictStr] = None
33
- classification: Optional[StrictStr] = Field(None, description="The classification/importance of the road/path. Used for a variety of purposes including fallback speed estimation and access for certain vehicle types.")
34
+ classification: Optional[StrictStr] = Field(default=None, description="The classification/importance of the road/path. Used for a variety of purposes including fallback speed estimation and access for certain vehicle types.")
34
35
  additional_properties: Dict[str, Any] = {}
35
- __properties = ["internal", "link", "surface", "use", "classification"]
36
+ __properties: ClassVar[List[str]] = ["internal", "link", "surface", "use", "classification"]
36
37
 
37
- @validator('surface')
38
+ @field_validator('surface')
38
39
  def surface_validate_enum(cls, value):
39
40
  """Validates the enum"""
40
41
  if value is None:
41
42
  return value
42
43
 
43
- if value not in ('paved_smooth', 'paved', 'paved_rough', 'compacted', 'dirt', 'gravel', 'path', 'impassable'):
44
+ if value not in set(['paved_smooth', 'paved', 'paved_rough', 'compacted', 'dirt', 'gravel', 'path', 'impassable']):
44
45
  raise ValueError("must be one of enum values ('paved_smooth', 'paved', 'paved_rough', 'compacted', 'dirt', 'gravel', 'path', 'impassable')")
45
46
  return value
46
47
 
47
- @validator('use')
48
+ @field_validator('use')
48
49
  def use_validate_enum(cls, value):
49
50
  """Validates the enum"""
50
51
  if value is None:
51
52
  return value
52
53
 
53
- if value not in ('road', 'ramp', 'turn_channel', 'track', 'driveway', 'alley', 'parking_aisle', 'emergency_access', 'drive_through', 'culdesac', 'living_street', 'service_road', 'cycleway', 'mountain_bike', 'sidewalk', 'footway', 'elevator', 'steps', 'escalator', 'path', 'pedestrian', 'bridleway', 'pedestrian_crossing', 'rest_area', 'service_area', 'other', 'rail', 'ferry', 'rail-ferry', 'bus', 'egress_connection', 'platform_connnection', 'transit_connection', 'construction'):
54
+ if value not in set(['road', 'ramp', 'turn_channel', 'track', 'driveway', 'alley', 'parking_aisle', 'emergency_access', 'drive_through', 'culdesac', 'living_street', 'service_road', 'cycleway', 'mountain_bike', 'sidewalk', 'footway', 'elevator', 'steps', 'escalator', 'path', 'pedestrian', 'bridleway', 'pedestrian_crossing', 'rest_area', 'service_area', 'other', 'rail', 'ferry', 'rail-ferry', 'bus', 'egress_connection', 'platform_connnection', 'transit_connection', 'construction']):
54
55
  raise ValueError("must be one of enum values ('road', 'ramp', 'turn_channel', 'track', 'driveway', 'alley', 'parking_aisle', 'emergency_access', 'drive_through', 'culdesac', 'living_street', 'service_road', 'cycleway', 'mountain_bike', 'sidewalk', 'footway', 'elevator', 'steps', 'escalator', 'path', 'pedestrian', 'bridleway', 'pedestrian_crossing', 'rest_area', 'service_area', 'other', 'rail', 'ferry', 'rail-ferry', 'bus', 'egress_connection', 'platform_connnection', 'transit_connection', 'construction')")
55
56
  return value
56
57
 
57
- @validator('classification')
58
+ @field_validator('classification')
58
59
  def classification_validate_enum(cls, value):
59
60
  """Validates the enum"""
60
61
  if value is None:
61
62
  return value
62
63
 
63
- if value not in ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'service_other'):
64
+ if value not in set(['motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'service_other']):
64
65
  raise ValueError("must be one of enum values ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'service_other')")
65
66
  return value
66
67
 
67
- class Config:
68
- """Pydantic configuration"""
69
- allow_population_by_field_name = True
70
- validate_assignment = True
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
71
74
 
72
75
  def to_str(self) -> str:
73
76
  """Returns the string representation of the model using alias"""
74
- return pprint.pformat(self.dict(by_alias=True))
77
+ return pprint.pformat(self.model_dump(by_alias=True))
75
78
 
76
79
  def to_json(self) -> str:
77
80
  """Returns the JSON representation of the model using alias"""
81
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
78
82
  return json.dumps(self.to_dict())
79
83
 
80
84
  @classmethod
81
- def from_json(cls, json_str: str) -> HighwayClassification:
85
+ def from_json(cls, json_str: str) -> Optional[Self]:
82
86
  """Create an instance of HighwayClassification from a JSON string"""
83
87
  return cls.from_dict(json.loads(json_str))
84
88
 
85
- def to_dict(self):
86
- """Returns the dictionary representation of the model using alias"""
87
- _dict = self.dict(by_alias=True,
88
- exclude={
89
- "additional_properties"
90
- },
91
- exclude_none=True)
89
+ def to_dict(self) -> Dict[str, Any]:
90
+ """Return the dictionary representation of the model using alias.
91
+
92
+ This has the following differences from calling pydantic's
93
+ `self.model_dump(by_alias=True)`:
94
+
95
+ * `None` is only added to the output dict for nullable fields that
96
+ were set at model initialization. Other fields with value `None`
97
+ are ignored.
98
+ * Fields in `self.additional_properties` are added to the output dict.
99
+ """
100
+ excluded_fields: Set[str] = set([
101
+ "additional_properties",
102
+ ])
103
+
104
+ _dict = self.model_dump(
105
+ by_alias=True,
106
+ exclude=excluded_fields,
107
+ exclude_none=True,
108
+ )
92
109
  # puts key-value pairs in additional_properties in the top level
93
110
  if self.additional_properties is not None:
94
111
  for _key, _value in self.additional_properties.items():
@@ -97,15 +114,15 @@ class HighwayClassification(BaseModel):
97
114
  return _dict
98
115
 
99
116
  @classmethod
100
- def from_dict(cls, obj: dict) -> HighwayClassification:
117
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
101
118
  """Create an instance of HighwayClassification from a dict"""
102
119
  if obj is None:
103
120
  return None
104
121
 
105
122
  if not isinstance(obj, dict):
106
- return HighwayClassification.parse_obj(obj)
123
+ return cls.model_validate(obj)
107
124
 
108
- _obj = HighwayClassification.parse_obj({
125
+ _obj = cls.model_validate({
109
126
  "internal": obj.get("internal"),
110
127
  "link": obj.get("link"),
111
128
  "surface": obj.get("surface"),
@@ -119,3 +136,4 @@ class HighwayClassification(BaseModel):
119
136
 
120
137
  return _obj
121
138
 
139
+
@@ -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.6
8
+ The version of the OpenAPI document: 6.1.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,53 +18,70 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
-
22
- from typing import Optional
23
- from pydantic import BaseModel, Field, StrictBool, StrictInt
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Optional
24
23
  from stadiamaps.models.edge_use import EdgeUse
25
24
  from stadiamaps.models.road_class import RoadClass
26
25
  from stadiamaps.models.traversability import Traversability
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
27
28
 
28
29
  class IntersectingEdge(BaseModel):
29
30
  """
30
31
  IntersectingEdge
31
- """
32
- begin_heading: Optional[StrictInt] = Field(None, description="The direction at the beginning of an edge. The units are degrees clockwise from north.")
33
- from_edge_name_consistency: Optional[StrictBool] = Field(None, description="True if this intersecting edge at the end node has consistent names with the path from the other edge.")
34
- to_edge_name_consistency: Optional[StrictBool] = Field(None, description="True if this intersecting edge at the end node has consistent names with the path to the other edge.")
32
+ """ # noqa: E501
33
+ begin_heading: Optional[StrictInt] = Field(default=None, description="The direction at the beginning of an edge. The units are degrees clockwise from north.")
34
+ from_edge_name_consistency: Optional[StrictBool] = Field(default=None, description="True if this intersecting edge at the end node has consistent names with the path from the other edge.")
35
+ to_edge_name_consistency: Optional[StrictBool] = Field(default=None, description="True if this intersecting edge at the end node has consistent names with the path to the other edge.")
35
36
  driveability: Optional[Traversability] = None
36
37
  cyclability: Optional[Traversability] = None
37
38
  walkability: Optional[Traversability] = None
38
39
  use: Optional[EdgeUse] = None
39
40
  road_class: Optional[RoadClass] = None
40
41
  additional_properties: Dict[str, Any] = {}
41
- __properties = ["begin_heading", "from_edge_name_consistency", "to_edge_name_consistency", "driveability", "cyclability", "walkability", "use", "road_class"]
42
+ __properties: ClassVar[List[str]] = ["begin_heading", "from_edge_name_consistency", "to_edge_name_consistency", "driveability", "cyclability", "walkability", "use", "road_class"]
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
42
49
 
43
- class Config:
44
- """Pydantic configuration"""
45
- allow_population_by_field_name = True
46
- validate_assignment = True
47
50
 
48
51
  def to_str(self) -> str:
49
52
  """Returns the string representation of the model using alias"""
50
- return pprint.pformat(self.dict(by_alias=True))
53
+ return pprint.pformat(self.model_dump(by_alias=True))
51
54
 
52
55
  def to_json(self) -> str:
53
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
54
58
  return json.dumps(self.to_dict())
55
59
 
56
60
  @classmethod
57
- def from_json(cls, json_str: str) -> IntersectingEdge:
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
62
  """Create an instance of IntersectingEdge from a JSON string"""
59
63
  return cls.from_dict(json.loads(json_str))
60
64
 
61
- def to_dict(self):
62
- """Returns the dictionary representation of the model using alias"""
63
- _dict = self.dict(by_alias=True,
64
- exclude={
65
- "additional_properties"
66
- },
67
- exclude_none=True)
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
+ )
68
85
  # puts key-value pairs in additional_properties in the top level
69
86
  if self.additional_properties is not None:
70
87
  for _key, _value in self.additional_properties.items():
@@ -73,15 +90,15 @@ class IntersectingEdge(BaseModel):
73
90
  return _dict
74
91
 
75
92
  @classmethod
76
- def from_dict(cls, obj: dict) -> IntersectingEdge:
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
94
  """Create an instance of IntersectingEdge from a dict"""
78
95
  if obj is None:
79
96
  return None
80
97
 
81
98
  if not isinstance(obj, dict):
82
- return IntersectingEdge.parse_obj(obj)
99
+ return cls.model_validate(obj)
83
100
 
84
- _obj = IntersectingEdge.parse_obj({
101
+ _obj = cls.model_validate({
85
102
  "begin_heading": obj.get("begin_heading"),
86
103
  "from_edge_name_consistency": obj.get("from_edge_name_consistency"),
87
104
  "to_edge_name_consistency": obj.get("to_edge_name_consistency"),
@@ -98,3 +115,4 @@ class IntersectingEdge(BaseModel):
98
115
 
99
116
  return _obj
100
117
 
118
+
@@ -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.6
8
+ The version of the OpenAPI document: 6.1.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 IsochroneCostingModel(str, Enum):
@@ -35,8 +32,8 @@ class IsochroneCostingModel(str, Enum):
35
32
  PEDESTRIAN = 'pedestrian'
36
33
 
37
34
  @classmethod
38
- def from_json(cls, json_str: str) -> IsochroneCostingModel:
35
+ def from_json(cls, json_str: str) -> Self:
39
36
  """Create an instance of IsochroneCostingModel from a JSON string"""
40
- return IsochroneCostingModel(json.loads(json_str))
37
+ return cls(json.loads(json_str))
41
38
 
42
39