stadiamaps 2.1.0__py3-none-any.whl → 3.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 (108) hide show
  1. stadiamaps/__init__.py +4 -2
  2. stadiamaps/api/geocoding_api.py +6 -6
  3. stadiamaps/api/geospatial_api.py +3 -3
  4. stadiamaps/api/routing_api.py +12 -12
  5. stadiamaps/api_client.py +37 -25
  6. stadiamaps/configuration.py +3 -3
  7. stadiamaps/exceptions.py +1 -1
  8. stadiamaps/models/__init__.py +3 -1
  9. stadiamaps/models/access.py +1 -1
  10. stadiamaps/models/admin_region.py +1 -1
  11. stadiamaps/models/administrative.py +1 -1
  12. stadiamaps/models/auto_costing_options.py +1 -1
  13. stadiamaps/models/base_costing_options.py +1 -1
  14. stadiamaps/models/base_trace_request.py +1 -1
  15. stadiamaps/models/bicycle_costing_options.py +1 -1
  16. stadiamaps/models/bike_network.py +1 -1
  17. stadiamaps/models/contour.py +1 -1
  18. stadiamaps/models/coordinate.py +1 -1
  19. stadiamaps/models/costing_model.py +2 -2
  20. stadiamaps/models/costing_options.py +9 -3
  21. stadiamaps/models/directions_options.py +1 -1
  22. stadiamaps/models/distance_unit.py +1 -1
  23. stadiamaps/models/edge_sign.py +1 -1
  24. stadiamaps/models/edge_use.py +1 -1
  25. stadiamaps/models/end_node.py +1 -1
  26. stadiamaps/models/geo_attributes.py +1 -1
  27. stadiamaps/models/geo_json_geometry.py +3 -3
  28. stadiamaps/models/geo_json_geometry_base.py +1 -1
  29. stadiamaps/models/geo_json_line_string.py +1 -1
  30. stadiamaps/models/geo_json_point.py +1 -1
  31. stadiamaps/models/geo_json_polygon.py +1 -1
  32. stadiamaps/models/geocoding_object.py +1 -1
  33. stadiamaps/models/height_request.py +1 -1
  34. stadiamaps/models/height_response.py +1 -1
  35. stadiamaps/models/highway_classification.py +1 -1
  36. stadiamaps/models/intersecting_edge.py +1 -1
  37. stadiamaps/models/isochrone_costing_model.py +1 -1
  38. stadiamaps/models/isochrone_feature.py +1 -1
  39. stadiamaps/models/isochrone_properties.py +1 -1
  40. stadiamaps/models/isochrone_request.py +1 -1
  41. stadiamaps/models/isochrone_response.py +1 -1
  42. stadiamaps/models/locate_detailed_edge.py +1 -1
  43. stadiamaps/models/locate_edge.py +1 -1
  44. stadiamaps/models/locate_edge_info.py +1 -1
  45. stadiamaps/models/locate_node.py +1 -1
  46. stadiamaps/models/locate_object.py +1 -1
  47. stadiamaps/models/low_speed_vehicle_costing_options.py +140 -0
  48. stadiamaps/models/maneuver_sign.py +1 -1
  49. stadiamaps/models/maneuver_sign_element.py +1 -1
  50. stadiamaps/models/map_match_costing_model.py +1 -1
  51. stadiamaps/models/map_match_request.py +1 -1
  52. stadiamaps/models/map_match_route_response.py +1 -1
  53. stadiamaps/models/map_match_trace_options.py +1 -1
  54. stadiamaps/models/map_match_waypoint.py +1 -1
  55. stadiamaps/models/matched_point.py +1 -1
  56. stadiamaps/models/matrix_costing_model.py +1 -1
  57. stadiamaps/models/matrix_distance.py +14 -4
  58. stadiamaps/models/matrix_request.py +6 -6
  59. stadiamaps/models/matrix_response.py +3 -3
  60. stadiamaps/models/matrix_waypoint.py +106 -0
  61. stadiamaps/models/motor_scooter_costing_options.py +1 -1
  62. stadiamaps/models/motorcycle_costing_options.py +1 -1
  63. stadiamaps/models/nearest_roads_request.py +1 -1
  64. stadiamaps/models/node_id.py +1 -1
  65. stadiamaps/models/node_type.py +1 -1
  66. stadiamaps/models/optimized_route_request.py +1 -1
  67. stadiamaps/models/pedestrian_costing_options.py +1 -1
  68. stadiamaps/models/pelias_geo_json_feature.py +1 -1
  69. stadiamaps/models/pelias_geo_json_properties.py +1 -1
  70. stadiamaps/models/pelias_geo_json_properties_addendum.py +1 -1
  71. stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +1 -1
  72. stadiamaps/models/pelias_layer.py +1 -1
  73. stadiamaps/models/pelias_response.py +1 -1
  74. stadiamaps/models/pelias_source.py +1 -1
  75. stadiamaps/models/restrictions.py +1 -1
  76. stadiamaps/models/road_class.py +1 -1
  77. stadiamaps/models/route_leg.py +9 -5
  78. stadiamaps/models/route_maneuver.py +1 -1
  79. stadiamaps/models/route_request.py +8 -4
  80. stadiamaps/models/route_response.py +1 -1
  81. stadiamaps/models/route_response_alternates_inner.py +1 -1
  82. stadiamaps/models/route_summary.py +1 -1
  83. stadiamaps/models/route_trip.py +1 -1
  84. stadiamaps/models/routing_response_waypoint.py +1 -1
  85. stadiamaps/models/routing_waypoint.py +1 -1
  86. stadiamaps/models/routing_waypoint_all_of_search_filter.py +1 -1
  87. stadiamaps/models/simple_routing_waypoint.py +1 -1
  88. stadiamaps/models/speeds.py +1 -1
  89. stadiamaps/models/trace_attribute_filter_options.py +1 -1
  90. stadiamaps/models/trace_attribute_key.py +1 -1
  91. stadiamaps/models/trace_attributes_base_response.py +1 -1
  92. stadiamaps/models/trace_attributes_request.py +1 -1
  93. stadiamaps/models/trace_attributes_response.py +1 -1
  94. stadiamaps/models/trace_edge.py +1 -1
  95. stadiamaps/models/travel_mode.py +1 -1
  96. stadiamaps/models/traversability.py +1 -1
  97. stadiamaps/models/truck_costing_options.py +1 -1
  98. stadiamaps/models/tz_response.py +1 -1
  99. stadiamaps/models/valhalla_languages.py +1 -1
  100. stadiamaps/models/valhalla_long_units.py +1 -1
  101. stadiamaps/models/warning.py +1 -1
  102. stadiamaps/rest.py +3 -1
  103. {stadiamaps-2.1.0.dist-info → stadiamaps-3.1.0.dist-info}/METADATA +1 -1
  104. stadiamaps-3.1.0.dist-info/RECORD +130 -0
  105. stadiamaps-2.1.0.dist-info/RECORD +0 -128
  106. {stadiamaps-2.1.0.dist-info → stadiamaps-3.1.0.dist-info}/LICENSE.txt +0 -0
  107. {stadiamaps-2.1.0.dist-info → stadiamaps-3.1.0.dist-info}/WHEEL +0 -0
  108. {stadiamaps-2.1.0.dist-info → stadiamaps-3.1.0.dist-info}/top_level.txt +0 -0
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -22,7 +22,7 @@ from stadiamaps.models.geo_json_line_string import GeoJSONLineString
22
22
  from stadiamaps.models.geo_json_point import GeoJSONPoint
23
23
  from stadiamaps.models.geo_json_polygon import GeoJSONPolygon
24
24
  from pydantic import StrictStr, Field
25
- from typing import Union, List, Optional, Dict
25
+ from typing import Union, List, Set, Optional, Dict
26
26
  from typing_extensions import Literal, Self
27
27
 
28
28
  GEOJSONGEOMETRY_ONE_OF_SCHEMAS = ["GeoJSONLineString", "GeoJSONPoint", "GeoJSONPolygon"]
@@ -38,7 +38,7 @@ class GeoJSONGeometry(BaseModel):
38
38
  # data type: GeoJSONPolygon
39
39
  oneof_schema_3_validator: Optional[GeoJSONPolygon] = None
40
40
  actual_instance: Optional[Union[GeoJSONLineString, GeoJSONPoint, GeoJSONPolygon]] = None
41
- one_of_schemas: List[str] = Field(default=Literal["GeoJSONLineString", "GeoJSONPoint", "GeoJSONPolygon"])
41
+ one_of_schemas: Set[str] = { "GeoJSONLineString", "GeoJSONPoint", "GeoJSONPolygon" }
42
42
 
43
43
  model_config = ConfigDict(
44
44
  validate_assignment=True,
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -0,0 +1,140 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Stadia Maps Geospatial APIs
5
+
6
+ The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
+
8
+ The version of the OpenAPI document: 6.3.0
9
+ Contact: support@stadiamaps.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class LowSpeedVehicleCostingOptions(BaseModel):
28
+ """
29
+ LowSpeedVehicleCostingOptions
30
+ """ # noqa: E501
31
+ maneuver_penalty: Optional[StrictInt] = Field(default=5, description="A penalty (in seconds) applied when transitioning between roads (determined by name).")
32
+ gate_cost: Optional[StrictInt] = Field(default=15, description="The estimated cost (in seconds) when a gate is encountered.")
33
+ gate_penalty: Optional[StrictInt] = Field(default=300, description="A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.")
34
+ country_crossing_cost: Optional[StrictInt] = Field(default=600, description="The estimated cost (in seconds) when encountering an international border.")
35
+ country_crossing_penalty: Optional[StrictInt] = Field(default=0, description="A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.")
36
+ service_penalty: Optional[StrictInt] = Field(default=None, description="A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.")
37
+ service_factor: Optional[Union[StrictFloat, StrictInt]] = Field(default=1, description="A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.")
38
+ use_living_streets: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.")
39
+ use_ferry: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=0.5, description="A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.")
40
+ ignore_restrictions: Optional[StrictBool] = Field(default=None, description="If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.")
41
+ ignore_non_vehicular_restrictions: Optional[StrictBool] = Field(default=None, description="If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.")
42
+ ignore_oneways: Optional[StrictBool] = Field(default=None, description="If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.")
43
+ vehicle_type: Optional[StrictStr] = Field(default='low_speed_vehicle', description="The type of vehicle: * low_speed_vehicle (BETA): a low-speed vehicle which falls under a different regulatory and licensing regime than automobiles (ex: LSV in the US and Canada, Quadricycles in the EU, etc.) * golf_cart: a street legal golf cart that is under a similar regulator regime as the generic LSV laws, but may need to follow special paths when available or abide by restrictions specific to golf carts.")
44
+ top_speed: Optional[Annotated[int, Field(le=60, strict=True, ge=20)]] = Field(default=35, description="The top speed (in kph) that the vehicle is capable of travelling. This impacts travel time calculations as well as which roads are preferred. A very low speed vehicle will tend to prefer lower speed roads even in the presence of other legal routes.")
45
+ max_allowed_speed_limit: Optional[Annotated[int, Field(le=80, strict=True, ge=20)]] = Field(default=57, description="The maximum speed limit for highways on which it is legal for the vehicle to travel. Defaults to 57 (kph; around 35 mph). Acceptable values range from 20 to 80. Highways with *tagged* speed limits higher than this value will not be routed over (some caveats apply; this feature is still BETA).")
46
+ additional_properties: Dict[str, Any] = {}
47
+ __properties: ClassVar[List[str]] = ["maneuver_penalty", "gate_cost", "gate_penalty", "country_crossing_cost", "country_crossing_penalty", "service_penalty", "service_factor", "use_living_streets", "use_ferry", "ignore_restrictions", "ignore_non_vehicular_restrictions", "ignore_oneways", "vehicle_type", "top_speed", "max_allowed_speed_limit"]
48
+
49
+ @field_validator('vehicle_type')
50
+ def vehicle_type_validate_enum(cls, value):
51
+ """Validates the enum"""
52
+ if value is None:
53
+ return value
54
+
55
+ if value not in set(['low_speed_vehicle', 'golf_cart']):
56
+ raise ValueError("must be one of enum values ('low_speed_vehicle', 'golf_cart')")
57
+ return value
58
+
59
+ model_config = ConfigDict(
60
+ populate_by_name=True,
61
+ validate_assignment=True,
62
+ protected_namespaces=(),
63
+ )
64
+
65
+
66
+ def to_str(self) -> str:
67
+ """Returns the string representation of the model using alias"""
68
+ return pprint.pformat(self.model_dump(by_alias=True))
69
+
70
+ def to_json(self) -> str:
71
+ """Returns the JSON representation of the model using alias"""
72
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
73
+ return json.dumps(self.to_dict())
74
+
75
+ @classmethod
76
+ def from_json(cls, json_str: str) -> Optional[Self]:
77
+ """Create an instance of LowSpeedVehicleCostingOptions from a JSON string"""
78
+ return cls.from_dict(json.loads(json_str))
79
+
80
+ def to_dict(self) -> Dict[str, Any]:
81
+ """Return the dictionary representation of the model using alias.
82
+
83
+ This has the following differences from calling pydantic's
84
+ `self.model_dump(by_alias=True)`:
85
+
86
+ * `None` is only added to the output dict for nullable fields that
87
+ were set at model initialization. Other fields with value `None`
88
+ are ignored.
89
+ * Fields in `self.additional_properties` are added to the output dict.
90
+ """
91
+ excluded_fields: Set[str] = set([
92
+ "additional_properties",
93
+ ])
94
+
95
+ _dict = self.model_dump(
96
+ by_alias=True,
97
+ exclude=excluded_fields,
98
+ exclude_none=True,
99
+ )
100
+ # puts key-value pairs in additional_properties in the top level
101
+ if self.additional_properties is not None:
102
+ for _key, _value in self.additional_properties.items():
103
+ _dict[_key] = _value
104
+
105
+ return _dict
106
+
107
+ @classmethod
108
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
109
+ """Create an instance of LowSpeedVehicleCostingOptions from a dict"""
110
+ if obj is None:
111
+ return None
112
+
113
+ if not isinstance(obj, dict):
114
+ return cls.model_validate(obj)
115
+
116
+ _obj = cls.model_validate({
117
+ "maneuver_penalty": obj.get("maneuver_penalty") if obj.get("maneuver_penalty") is not None else 5,
118
+ "gate_cost": obj.get("gate_cost") if obj.get("gate_cost") is not None else 15,
119
+ "gate_penalty": obj.get("gate_penalty") if obj.get("gate_penalty") is not None else 300,
120
+ "country_crossing_cost": obj.get("country_crossing_cost") if obj.get("country_crossing_cost") is not None else 600,
121
+ "country_crossing_penalty": obj.get("country_crossing_penalty") if obj.get("country_crossing_penalty") is not None else 0,
122
+ "service_penalty": obj.get("service_penalty"),
123
+ "service_factor": obj.get("service_factor") if obj.get("service_factor") is not None else 1,
124
+ "use_living_streets": obj.get("use_living_streets"),
125
+ "use_ferry": obj.get("use_ferry") if obj.get("use_ferry") is not None else 0.5,
126
+ "ignore_restrictions": obj.get("ignore_restrictions"),
127
+ "ignore_non_vehicular_restrictions": obj.get("ignore_non_vehicular_restrictions"),
128
+ "ignore_oneways": obj.get("ignore_oneways"),
129
+ "vehicle_type": obj.get("vehicle_type") if obj.get("vehicle_type") is not None else 'low_speed_vehicle',
130
+ "top_speed": obj.get("top_speed") if obj.get("top_speed") is not None else 35,
131
+ "max_allowed_speed_limit": obj.get("max_allowed_speed_limit") if obj.get("max_allowed_speed_limit") is not None else 57
132
+ })
133
+ # store additional fields in additional_properties
134
+ for _key in obj.keys():
135
+ if _key not in cls.__properties:
136
+ _obj.additional_properties[_key] = obj.get(_key)
137
+
138
+ return _obj
139
+
140
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -19,7 +19,7 @@ import re # noqa: F401
19
19
  import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
22
- from typing import Any, ClassVar, Dict, List, Union
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
@@ -27,8 +27,8 @@ class MatrixDistance(BaseModel):
27
27
  """
28
28
  MatrixDistance
29
29
  """ # noqa: E501
30
- distance: Union[StrictFloat, StrictInt] = Field(description="The distance (in `units`) between the location in `sources` at `from_index` and the location in `targets` at `to_index`.")
31
- time: StrictInt = Field(description="The travel time (in seconds) between the location in `sources` at `from_index` and the location in `targets` at `to_index`.")
30
+ distance: Optional[Union[StrictFloat, StrictInt]] = Field(description="The distance (in `units`) between the location in `sources` at `from_index` and the location in `targets` at `to_index`. This value may be 0 in the case that the source and destination are the same, and `null` if no route was found between the locations.")
31
+ time: Optional[StrictInt] = Field(description="The travel time (in seconds) between the location in `sources` at `from_index` and the location in `targets` at `to_index`. This value may be 0 in the case that the source and destination are the same, and `null` if no route was found between the locations.")
32
32
  from_index: StrictInt = Field(description="The index of the start location in the `sources` array.")
33
33
  to_index: StrictInt = Field(description="The index of the end location in the `targets` array.")
34
34
  additional_properties: Dict[str, Any] = {}
@@ -80,6 +80,16 @@ class MatrixDistance(BaseModel):
80
80
  for _key, _value in self.additional_properties.items():
81
81
  _dict[_key] = _value
82
82
 
83
+ # set to None if distance (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.distance is None and "distance" in self.model_fields_set:
86
+ _dict['distance'] = None
87
+
88
+ # set to None if time (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.time is None and "time" in self.model_fields_set:
91
+ _dict['time'] = None
92
+
83
93
  return _dict
84
94
 
85
95
  @classmethod
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -21,10 +21,10 @@ import json
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
- from stadiamaps.models.coordinate import Coordinate
25
24
  from stadiamaps.models.costing_options import CostingOptions
26
25
  from stadiamaps.models.distance_unit import DistanceUnit
27
26
  from stadiamaps.models.matrix_costing_model import MatrixCostingModel
27
+ from stadiamaps.models.matrix_waypoint import MatrixWaypoint
28
28
  from stadiamaps.models.valhalla_languages import ValhallaLanguages
29
29
  from typing import Optional, Set
30
30
  from typing_extensions import Self
@@ -37,8 +37,8 @@ class MatrixRequest(BaseModel):
37
37
  language: Optional[ValhallaLanguages] = None
38
38
  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.")
39
39
  id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
40
- sources: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of starting locations")
41
- targets: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of ending locations")
40
+ sources: Annotated[List[MatrixWaypoint], Field(min_length=1)] = Field(description="The list of starting locations")
41
+ targets: Annotated[List[MatrixWaypoint], Field(min_length=1)] = Field(description="The list of ending locations")
42
42
  costing: MatrixCostingModel
43
43
  costing_options: Optional[CostingOptions] = None
44
44
  matrix_locations: Optional[StrictInt] = Field(default=None, description="Only applicable to one-to-many or many-to-one requests. This defaults to all locations. When specified explicitly, this option allows a partial result to be returned. This is basically equivalent to \"find the closest/best locations out of the full set.\" This can have a dramatic improvement for large requests.")
@@ -134,8 +134,8 @@ class MatrixRequest(BaseModel):
134
134
  "language": obj.get("language"),
135
135
  "directions_type": obj.get("directions_type") if obj.get("directions_type") is not None else 'instructions',
136
136
  "id": obj.get("id"),
137
- "sources": [Coordinate.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None,
138
- "targets": [Coordinate.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None,
137
+ "sources": [MatrixWaypoint.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None,
138
+ "targets": [MatrixWaypoint.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None,
139
139
  "costing": obj.get("costing"),
140
140
  "costing_options": CostingOptions.from_dict(obj["costing_options"]) if obj.get("costing_options") is not None else None,
141
141
  "matrix_locations": obj.get("matrix_locations")
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
7
7
 
8
- The version of the OpenAPI document: 6.1.0
8
+ The version of the OpenAPI document: 6.3.0
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -33,8 +33,8 @@ class MatrixResponse(BaseModel):
33
33
  MatrixResponse
34
34
  """ # noqa: E501
35
35
  id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
36
- sources: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of starting locations")
37
- targets: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of ending locations")
36
+ sources: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of starting locations determined by snapping to the nearest appropriate point on the road network for the costing model. All locations appear in the same order as the input.")
37
+ targets: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of ending locations determined by snapping to the nearest appropriate point on the road network for the costing model. All locations appear in the same order as the input.")
38
38
  sources_to_targets: Annotated[List[List[MatrixDistance]], Field(min_length=1)] = Field(description="The matrix of starting and ending locations, along with the computed distance and travel time. The array is row-ordered. This means that the time and distance from the first location to all others forms the first row of the array, followed by the time and distance from the second source location to all target locations, etc.")
39
39
  warnings: Optional[List[Warning]] = None
40
40
  units: ValhallaLongUnits