stadiamaps 1.0.6__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stadiamaps/__init__.py +6 -24
- stadiamaps/api/geocoding_api.py +1917 -760
- stadiamaps/api/geospatial_api.py +483 -221
- stadiamaps/api/routing_api.py +1615 -723
- stadiamaps/api_client.py +275 -272
- stadiamaps/api_response.py +12 -16
- stadiamaps/configuration.py +13 -11
- stadiamaps/exceptions.py +67 -30
- stadiamaps/models/__init__.py +5 -23
- stadiamaps/models/access.py +44 -26
- stadiamaps/models/admin_region.py +46 -28
- stadiamaps/models/administrative.py +48 -30
- stadiamaps/models/auto_costing_options.py +69 -48
- stadiamaps/models/auto_costing_options_all_of.py +1 -1
- stadiamaps/models/base_costing_options.py +52 -33
- stadiamaps/models/base_trace_request.py +70 -40
- stadiamaps/models/bicycle_costing_options.py +61 -42
- stadiamaps/models/bicycle_costing_options_all_of.py +1 -1
- stadiamaps/models/bike_network.py +42 -24
- stadiamaps/models/contour.py +45 -27
- stadiamaps/models/coordinate.py +45 -26
- stadiamaps/models/costing_model.py +10 -12
- stadiamaps/models/costing_options.py +51 -33
- stadiamaps/models/directions_options.py +45 -27
- stadiamaps/models/distance_unit.py +8 -11
- stadiamaps/models/edge_sign.py +46 -28
- stadiamaps/models/edge_use.py +8 -11
- stadiamaps/models/end_node.py +48 -30
- stadiamaps/models/geo_attributes.py +47 -29
- stadiamaps/models/geo_json_geometry.py +25 -25
- stadiamaps/models/geo_json_geometry_base.py +45 -27
- stadiamaps/models/geo_json_line_string.py +47 -28
- stadiamaps/models/geo_json_line_string_all_of.py +2 -2
- stadiamaps/models/geo_json_point.py +47 -28
- stadiamaps/models/geo_json_point_all_of.py +2 -2
- stadiamaps/models/geo_json_polygon.py +47 -28
- stadiamaps/models/geo_json_polygon_all_of.py +2 -2
- stadiamaps/models/geocoding_object.py +46 -28
- stadiamaps/models/height_request.py +55 -34
- stadiamaps/models/height_response.py +49 -30
- stadiamaps/models/highway_classification.py +52 -34
- stadiamaps/models/intersecting_edge.py +45 -27
- stadiamaps/models/isochrone_costing_model.py +8 -11
- stadiamaps/models/isochrone_feature.py +45 -27
- stadiamaps/models/isochrone_properties.py +48 -30
- stadiamaps/models/isochrone_request.py +54 -35
- stadiamaps/models/isochrone_response.py +47 -29
- stadiamaps/models/locate_detailed_edge.py +73 -55
- stadiamaps/models/locate_edge.py +56 -39
- stadiamaps/models/locate_edge_info.py +47 -29
- stadiamaps/models/locate_node.py +50 -31
- stadiamaps/models/locate_node_all_of.py +1 -1
- stadiamaps/models/locate_object.py +49 -31
- stadiamaps/models/maneuver_sign.py +50 -32
- stadiamaps/models/maneuver_sign_element.py +45 -27
- stadiamaps/models/map_match_costing_model.py +8 -11
- stadiamaps/models/map_match_request.py +74 -44
- stadiamaps/models/map_match_request_all_of.py +1 -1
- stadiamaps/models/map_match_route_response.py +57 -29
- stadiamaps/models/map_match_route_response_all_of.py +1 -1
- stadiamaps/models/map_match_trace_options.py +47 -29
- stadiamaps/models/map_match_waypoint.py +49 -30
- stadiamaps/models/map_match_waypoint_all_of.py +1 -1
- stadiamaps/models/matched_point.py +52 -34
- stadiamaps/models/matrix_costing_model.py +9 -12
- stadiamaps/models/matrix_distance.py +46 -28
- stadiamaps/models/matrix_request.py +70 -39
- stadiamaps/models/matrix_response.py +60 -36
- stadiamaps/models/motor_scooter_costing_options.py +70 -49
- stadiamaps/models/motor_scooter_costing_options_all_of.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +69 -48
- stadiamaps/models/motorcycle_costing_options_all_of.py +1 -1
- stadiamaps/models/nearest_roads_request.py +65 -34
- stadiamaps/models/node_id.py +42 -24
- stadiamaps/models/node_type.py +8 -11
- stadiamaps/models/optimized_route_request.py +66 -35
- stadiamaps/models/pedestrian_costing_options.py +59 -40
- stadiamaps/models/pelias_geo_json_feature.py +50 -31
- stadiamaps/models/pelias_geo_json_properties.py +54 -36
- stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
- stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
- stadiamaps/models/pelias_layer.py +8 -11
- stadiamaps/models/pelias_response.py +49 -30
- stadiamaps/models/pelias_response_geocoding.py +1 -1
- stadiamaps/models/pelias_source.py +8 -11
- stadiamaps/models/restrictions.py +44 -26
- stadiamaps/models/road_class.py +8 -11
- stadiamaps/models/route_leg.py +48 -29
- stadiamaps/models/route_maneuver.py +73 -55
- stadiamaps/models/route_request.py +76 -43
- stadiamaps/models/route_response.py +56 -28
- stadiamaps/models/route_response_alternates_inner.py +105 -0
- stadiamaps/models/route_response_trip.py +1 -1
- stadiamaps/models/route_summary.py +48 -30
- stadiamaps/models/route_trip.py +135 -0
- stadiamaps/models/routing_response_waypoint.py +49 -30
- stadiamaps/models/routing_response_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint.py +60 -41
- stadiamaps/models/routing_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
- stadiamaps/models/simple_routing_waypoint.py +48 -29
- stadiamaps/models/simple_routing_waypoint_all_of.py +1 -1
- stadiamaps/models/speeds.py +49 -31
- stadiamaps/models/trace_attribute_filter_options.py +47 -28
- stadiamaps/models/trace_attribute_key.py +8 -11
- stadiamaps/models/trace_attributes_base_response.py +51 -32
- stadiamaps/models/trace_attributes_request.py +72 -42
- stadiamaps/models/trace_attributes_request_all_of.py +1 -1
- stadiamaps/models/trace_attributes_request_all_of_filters.py +2 -2
- stadiamaps/models/trace_attributes_response.py +54 -35
- stadiamaps/models/trace_attributes_response_all_of.py +1 -1
- stadiamaps/models/trace_edge.py +88 -70
- stadiamaps/models/travel_mode.py +8 -11
- stadiamaps/models/traversability.py +8 -11
- stadiamaps/models/truck_costing_options.py +72 -51
- stadiamaps/models/truck_costing_options_all_of.py +1 -1
- stadiamaps/models/tz_response.py +45 -27
- stadiamaps/models/valhalla_languages.py +8 -11
- stadiamaps/models/valhalla_long_units.py +8 -11
- stadiamaps/models/warning.py +42 -24
- stadiamaps/py.typed +0 -0
- stadiamaps/rest.py +127 -172
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/METADATA +4 -4
- stadiamaps-2.0.0.dist-info/RECORD +128 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/WHEEL +1 -1
- stadiamaps-1.0.6.dist-info/RECORD +0 -125
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/top_level.txt +0 -0
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,69 +18,88 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional, Union
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt
|
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
|
24
26
|
|
25
27
|
class TruckCostingOptions(BaseModel):
|
26
28
|
"""
|
27
29
|
TruckCostingOptions
|
28
|
-
"""
|
29
|
-
maneuver_penalty: Optional[StrictInt] = Field(5, description="A penalty (in seconds) applied when transitioning between roads (determined by name).")
|
30
|
-
gate_cost: Optional[StrictInt] = Field(15, description="The estimated cost (in seconds) when a gate is encountered.")
|
31
|
-
gate_penalty: Optional[StrictInt] = Field(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.")
|
32
|
-
country_crossing_cost: Optional[StrictInt] = Field(600, description="The estimated cost (in seconds) when encountering an international border.")
|
33
|
-
country_crossing_penalty: Optional[StrictInt] = Field(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.")
|
34
|
-
service_penalty: Optional[StrictInt] = Field(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.")
|
35
|
-
service_factor: Optional[Union[StrictFloat, StrictInt]] = Field(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.")
|
36
|
-
use_living_streets: Optional[Union[
|
37
|
-
use_ferry: Optional[Union[
|
38
|
-
height: Optional[Union[StrictFloat, StrictInt]] = Field(4.11, description="The height of the truck (in meters).")
|
39
|
-
width: Optional[Union[StrictFloat, StrictInt]] = Field(2.6, description="The width of the truck (in meters).")
|
40
|
-
toll_booth_cost: Optional[StrictInt] = Field(15, description="The estimated cost (in seconds) when a toll booth is encountered.")
|
41
|
-
toll_booth_penalty: Optional[StrictInt] = Field(0, description="A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.")
|
42
|
-
ferry_cost: Optional[StrictInt] = Field(300, description="The estimated cost (in seconds) when a ferry is encountered.")
|
43
|
-
use_highways: Optional[Union[
|
44
|
-
use_tolls: Optional[Union[
|
45
|
-
use_tracks: Optional[Union[
|
46
|
-
top_speed: Optional[
|
47
|
-
shortest: Optional[StrictBool] = Field(False, description="If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.")
|
48
|
-
ignore_closures: Optional[StrictBool] = Field(False, description="If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.")
|
49
|
-
include_hov2: Optional[StrictBool] = Field(False, description="If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.")
|
50
|
-
include_hov3: Optional[StrictBool] = Field(False, description="If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.")
|
51
|
-
include_hot: Optional[StrictBool] = Field(False, description="If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met")
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
+
height: Optional[Union[StrictFloat, StrictInt]] = Field(default=4.11, description="The height of the truck (in meters).")
|
41
|
+
width: Optional[Union[StrictFloat, StrictInt]] = Field(default=2.6, description="The width of the truck (in meters).")
|
42
|
+
toll_booth_cost: Optional[StrictInt] = Field(default=15, description="The estimated cost (in seconds) when a toll booth is encountered.")
|
43
|
+
toll_booth_penalty: Optional[StrictInt] = Field(default=0, description="A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.")
|
44
|
+
ferry_cost: Optional[StrictInt] = Field(default=300, description="The estimated cost (in seconds) when a ferry is encountered.")
|
45
|
+
use_highways: 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 highways. Values near 0 attempt to avoid highways, and values near 1 will favour them. Note that as some routes may be impossible without highways, 0 does not guarantee avoidance of them.")
|
46
|
+
use_tolls: 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 toll roads. Values near 0 attempt to avoid tolls, and values near 1 will favour them. Note that as some routes may be impossible without tolls, 0 does not guarantee avoidance of them.")
|
47
|
+
use_tracks: 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 track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.")
|
48
|
+
top_speed: Optional[Annotated[int, Field(le=252, strict=True, ge=10)]] = Field(default=140, description="The top speed (in kph) that the vehicle is capable of travelling.")
|
49
|
+
shortest: Optional[StrictBool] = Field(default=False, description="If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.")
|
50
|
+
ignore_closures: Optional[StrictBool] = Field(default=False, description="If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.")
|
51
|
+
include_hov2: Optional[StrictBool] = Field(default=False, description="If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.")
|
52
|
+
include_hov3: Optional[StrictBool] = Field(default=False, description="If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.")
|
53
|
+
include_hot: Optional[StrictBool] = Field(default=False, description="If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met")
|
54
|
+
alley_factor: Optional[Union[StrictFloat, StrictInt]] = Field(default=1, description="A factor that multiplies the cost when alleys are encountered.")
|
55
|
+
length: Optional[Union[StrictFloat, StrictInt]] = Field(default=21.64, description="The length of the truck (in meters).")
|
56
|
+
weight: Optional[Union[StrictFloat, StrictInt]] = Field(default=21.77, description="The weight of the truck (in tonnes).")
|
57
|
+
axle_load: Optional[Union[StrictFloat, StrictInt]] = Field(default=9.07, description="The axle load of the truck (in tonnes).")
|
58
|
+
hazmat: Optional[StrictBool] = Field(default=False, description="Whether or not the truck is carrying hazardous materials.")
|
56
59
|
additional_properties: Dict[str, Any] = {}
|
57
|
-
__properties = ["maneuver_penalty", "gate_cost", "gate_penalty", "country_crossing_cost", "country_crossing_penalty", "service_penalty", "service_factor", "use_living_streets", "use_ferry", "height", "width", "toll_booth_cost", "toll_booth_penalty", "ferry_cost", "use_highways", "use_tolls", "use_tracks", "top_speed", "shortest", "ignore_closures", "include_hov2", "include_hov3", "include_hot", "length", "weight", "axle_load", "hazmat"]
|
60
|
+
__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", "height", "width", "toll_booth_cost", "toll_booth_penalty", "ferry_cost", "use_highways", "use_tolls", "use_tracks", "top_speed", "shortest", "ignore_closures", "include_hov2", "include_hov3", "include_hot", "alley_factor", "length", "weight", "axle_load", "hazmat"]
|
61
|
+
|
62
|
+
model_config = ConfigDict(
|
63
|
+
populate_by_name=True,
|
64
|
+
validate_assignment=True,
|
65
|
+
protected_namespaces=(),
|
66
|
+
)
|
58
67
|
|
59
|
-
class Config:
|
60
|
-
"""Pydantic configuration"""
|
61
|
-
allow_population_by_field_name = True
|
62
|
-
validate_assignment = True
|
63
68
|
|
64
69
|
def to_str(self) -> str:
|
65
70
|
"""Returns the string representation of the model using alias"""
|
66
|
-
return pprint.pformat(self.
|
71
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
67
72
|
|
68
73
|
def to_json(self) -> str:
|
69
74
|
"""Returns the JSON representation of the model using alias"""
|
75
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
70
76
|
return json.dumps(self.to_dict())
|
71
77
|
|
72
78
|
@classmethod
|
73
|
-
def from_json(cls, json_str: str) ->
|
79
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
74
80
|
"""Create an instance of TruckCostingOptions from a JSON string"""
|
75
81
|
return cls.from_dict(json.loads(json_str))
|
76
82
|
|
77
|
-
def to_dict(self):
|
78
|
-
"""
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
def to_dict(self) -> Dict[str, Any]:
|
84
|
+
"""Return the dictionary representation of the model using alias.
|
85
|
+
|
86
|
+
This has the following differences from calling pydantic's
|
87
|
+
`self.model_dump(by_alias=True)`:
|
88
|
+
|
89
|
+
* `None` is only added to the output dict for nullable fields that
|
90
|
+
were set at model initialization. Other fields with value `None`
|
91
|
+
are ignored.
|
92
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
93
|
+
"""
|
94
|
+
excluded_fields: Set[str] = set([
|
95
|
+
"additional_properties",
|
96
|
+
])
|
97
|
+
|
98
|
+
_dict = self.model_dump(
|
99
|
+
by_alias=True,
|
100
|
+
exclude=excluded_fields,
|
101
|
+
exclude_none=True,
|
102
|
+
)
|
84
103
|
# puts key-value pairs in additional_properties in the top level
|
85
104
|
if self.additional_properties is not None:
|
86
105
|
for _key, _value in self.additional_properties.items():
|
@@ -89,15 +108,15 @@ class TruckCostingOptions(BaseModel):
|
|
89
108
|
return _dict
|
90
109
|
|
91
110
|
@classmethod
|
92
|
-
def from_dict(cls, obj:
|
111
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
112
|
"""Create an instance of TruckCostingOptions from a dict"""
|
94
113
|
if obj is None:
|
95
114
|
return None
|
96
115
|
|
97
116
|
if not isinstance(obj, dict):
|
98
|
-
return
|
117
|
+
return cls.model_validate(obj)
|
99
118
|
|
100
|
-
_obj =
|
119
|
+
_obj = cls.model_validate({
|
101
120
|
"maneuver_penalty": obj.get("maneuver_penalty") if obj.get("maneuver_penalty") is not None else 5,
|
102
121
|
"gate_cost": obj.get("gate_cost") if obj.get("gate_cost") is not None else 15,
|
103
122
|
"gate_penalty": obj.get("gate_penalty") if obj.get("gate_penalty") is not None else 300,
|
@@ -121,6 +140,7 @@ class TruckCostingOptions(BaseModel):
|
|
121
140
|
"include_hov2": obj.get("include_hov2") if obj.get("include_hov2") is not None else False,
|
122
141
|
"include_hov3": obj.get("include_hov3") if obj.get("include_hov3") is not None else False,
|
123
142
|
"include_hot": obj.get("include_hot") if obj.get("include_hot") is not None else False,
|
143
|
+
"alley_factor": obj.get("alley_factor") if obj.get("alley_factor") is not None else 1,
|
124
144
|
"length": obj.get("length") if obj.get("length") is not None else 21.64,
|
125
145
|
"weight": obj.get("weight") if obj.get("weight") is not None else 21.77,
|
126
146
|
"axle_load": obj.get("axle_load") if obj.get("axle_load") is not None else 9.07,
|
@@ -133,3 +153,4 @@ class TruckCostingOptions(BaseModel):
|
|
133
153
|
|
134
154
|
return _obj
|
135
155
|
|
156
|
+
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications. # noqa: E501
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 5.0.
|
8
|
+
The version of the OpenAPI document: 5.0.6
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/tz_response.py
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,45 +18,62 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
24
25
|
|
25
26
|
class TzResponse(BaseModel):
|
26
27
|
"""
|
27
28
|
TzResponse
|
28
|
-
"""
|
29
|
-
tz_id: StrictStr = Field(
|
30
|
-
base_utc_offset: StrictInt = Field(
|
31
|
-
dst_offset: StrictInt = Field(
|
29
|
+
""" # noqa: E501
|
30
|
+
tz_id: StrictStr = Field(description="The canonical time zone ID. In the event that multiple time zones could be returned, the first one from the Unicode CLDR timezone.xml is returned.")
|
31
|
+
base_utc_offset: StrictInt = Field(description="The base offset, in seconds, from UTC that is normally in effect for this time zone.")
|
32
|
+
dst_offset: StrictInt = Field(description="The special offset, in seconds, from UTC that is in effect for this time zone as of the queried timestamp (defaults to now). If no additional offsets are in effect, this value is zero. This typically reflects Daylight Saving Time, but may indicate other special offsets. To get the total offset in effect, add `dst_offset` and `utc_offset` together.")
|
32
33
|
additional_properties: Dict[str, Any] = {}
|
33
|
-
__properties = ["tz_id", "base_utc_offset", "dst_offset"]
|
34
|
+
__properties: ClassVar[List[str]] = ["tz_id", "base_utc_offset", "dst_offset"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
34
41
|
|
35
|
-
class Config:
|
36
|
-
"""Pydantic configuration"""
|
37
|
-
allow_population_by_field_name = True
|
38
|
-
validate_assignment = True
|
39
42
|
|
40
43
|
def to_str(self) -> str:
|
41
44
|
"""Returns the string representation of the model using alias"""
|
42
|
-
return pprint.pformat(self.
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
43
46
|
|
44
47
|
def to_json(self) -> str:
|
45
48
|
"""Returns the JSON representation of the model using alias"""
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
46
50
|
return json.dumps(self.to_dict())
|
47
51
|
|
48
52
|
@classmethod
|
49
|
-
def from_json(cls, json_str: str) ->
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
54
|
"""Create an instance of TzResponse from a JSON string"""
|
51
55
|
return cls.from_dict(json.loads(json_str))
|
52
56
|
|
53
|
-
def to_dict(self):
|
54
|
-
"""
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
59
|
+
|
60
|
+
This has the following differences from calling pydantic's
|
61
|
+
`self.model_dump(by_alias=True)`:
|
62
|
+
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
64
|
+
were set at model initialization. Other fields with value `None`
|
65
|
+
are ignored.
|
66
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
"additional_properties",
|
70
|
+
])
|
71
|
+
|
72
|
+
_dict = self.model_dump(
|
73
|
+
by_alias=True,
|
74
|
+
exclude=excluded_fields,
|
75
|
+
exclude_none=True,
|
76
|
+
)
|
60
77
|
# puts key-value pairs in additional_properties in the top level
|
61
78
|
if self.additional_properties is not None:
|
62
79
|
for _key, _value in self.additional_properties.items():
|
@@ -65,15 +82,15 @@ class TzResponse(BaseModel):
|
|
65
82
|
return _dict
|
66
83
|
|
67
84
|
@classmethod
|
68
|
-
def from_dict(cls, obj:
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
69
86
|
"""Create an instance of TzResponse from a dict"""
|
70
87
|
if obj is None:
|
71
88
|
return None
|
72
89
|
|
73
90
|
if not isinstance(obj, dict):
|
74
|
-
return
|
91
|
+
return cls.model_validate(obj)
|
75
92
|
|
76
|
-
_obj =
|
93
|
+
_obj = cls.model_validate({
|
77
94
|
"tz_id": obj.get("tz_id"),
|
78
95
|
"base_utc_offset": obj.get("base_utc_offset"),
|
79
96
|
"dst_offset": obj.get("dst_offset")
|
@@ -85,3 +102,4 @@ class TzResponse(BaseModel):
|
|
85
102
|
|
86
103
|
return _obj
|
87
104
|
|
105
|
+
|
@@ -3,23 +3,20 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
|
+
from __future__ import annotations
|
16
17
|
import json
|
17
|
-
import
|
18
|
-
|
19
|
-
from aenum import Enum, no_arg
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
from enum import Enum
|
19
|
+
from typing_extensions import Self
|
23
20
|
|
24
21
|
|
25
22
|
class ValhallaLanguages(str, Enum):
|
@@ -61,8 +58,8 @@ class ValhallaLanguages(str, Enum):
|
|
61
58
|
UK_MINUS_UA = 'uk-UA'
|
62
59
|
|
63
60
|
@classmethod
|
64
|
-
def from_json(cls, json_str: str) ->
|
61
|
+
def from_json(cls, json_str: str) -> Self:
|
65
62
|
"""Create an instance of ValhallaLanguages from a JSON string"""
|
66
|
-
return
|
63
|
+
return cls(json.loads(json_str))
|
67
64
|
|
68
65
|
|
@@ -3,23 +3,20 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
|
+
from __future__ import annotations
|
16
17
|
import json
|
17
|
-
import
|
18
|
-
|
19
|
-
from aenum import Enum, no_arg
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
from enum import Enum
|
19
|
+
from typing_extensions import Self
|
23
20
|
|
24
21
|
|
25
22
|
class ValhallaLongUnits(str, Enum):
|
@@ -34,8 +31,8 @@ class ValhallaLongUnits(str, Enum):
|
|
34
31
|
KILOMETERS = 'kilometers'
|
35
32
|
|
36
33
|
@classmethod
|
37
|
-
def from_json(cls, json_str: str) ->
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
38
35
|
"""Create an instance of ValhallaLongUnits from a JSON string"""
|
39
|
-
return
|
36
|
+
return cls(json.loads(json_str))
|
40
37
|
|
41
38
|
|
stadiamaps/models/warning.py
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,44 +18,61 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
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 Warning(BaseModel):
|
26
27
|
"""
|
27
28
|
Warning
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
29
30
|
text: Optional[StrictStr] = None
|
30
31
|
code: Optional[StrictInt] = None
|
31
32
|
additional_properties: Dict[str, Any] = {}
|
32
|
-
__properties = ["text", "code"]
|
33
|
+
__properties: ClassVar[List[str]] = ["text", "code"]
|
34
|
+
|
35
|
+
model_config = ConfigDict(
|
36
|
+
populate_by_name=True,
|
37
|
+
validate_assignment=True,
|
38
|
+
protected_namespaces=(),
|
39
|
+
)
|
33
40
|
|
34
|
-
class Config:
|
35
|
-
"""Pydantic configuration"""
|
36
|
-
allow_population_by_field_name = True
|
37
|
-
validate_assignment = True
|
38
41
|
|
39
42
|
def to_str(self) -> str:
|
40
43
|
"""Returns the string representation of the model using alias"""
|
41
|
-
return pprint.pformat(self.
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
42
45
|
|
43
46
|
def to_json(self) -> str:
|
44
47
|
"""Returns the JSON representation of the model using alias"""
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
45
49
|
return json.dumps(self.to_dict())
|
46
50
|
|
47
51
|
@classmethod
|
48
|
-
def from_json(cls, json_str: str) ->
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
49
53
|
"""Create an instance of Warning from a JSON string"""
|
50
54
|
return cls.from_dict(json.loads(json_str))
|
51
55
|
|
52
|
-
def to_dict(self):
|
53
|
-
"""
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
58
|
+
|
59
|
+
This has the following differences from calling pydantic's
|
60
|
+
`self.model_dump(by_alias=True)`:
|
61
|
+
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
63
|
+
were set at model initialization. Other fields with value `None`
|
64
|
+
are ignored.
|
65
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
66
|
+
"""
|
67
|
+
excluded_fields: Set[str] = set([
|
68
|
+
"additional_properties",
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
59
76
|
# puts key-value pairs in additional_properties in the top level
|
60
77
|
if self.additional_properties is not None:
|
61
78
|
for _key, _value in self.additional_properties.items():
|
@@ -64,15 +81,15 @@ class Warning(BaseModel):
|
|
64
81
|
return _dict
|
65
82
|
|
66
83
|
@classmethod
|
67
|
-
def from_dict(cls, obj:
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
68
85
|
"""Create an instance of Warning from a dict"""
|
69
86
|
if obj is None:
|
70
87
|
return None
|
71
88
|
|
72
89
|
if not isinstance(obj, dict):
|
73
|
-
return
|
90
|
+
return cls.model_validate(obj)
|
74
91
|
|
75
|
-
_obj =
|
92
|
+
_obj = cls.model_validate({
|
76
93
|
"text": obj.get("text"),
|
77
94
|
"code": obj.get("code")
|
78
95
|
})
|
@@ -83,3 +100,4 @@ class Warning(BaseModel):
|
|
83
100
|
|
84
101
|
return _obj
|
85
102
|
|
103
|
+
|
stadiamaps/py.typed
ADDED
File without changes
|