stadiamaps 3.2.0__py3-none-any.whl → 4.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 +24 -4
- stadiamaps/api/geocoding_api.py +1 -1
- stadiamaps/api/geospatial_api.py +1 -1
- stadiamaps/api/routing_api.py +12 -12
- stadiamaps/api_client.py +9 -2
- stadiamaps/configuration.py +3 -3
- stadiamaps/exceptions.py +1 -1
- stadiamaps/models/__init__.py +23 -3
- stadiamaps/models/access.py +1 -1
- stadiamaps/models/admin_region.py +1 -1
- stadiamaps/models/administrative.py +1 -1
- stadiamaps/models/annotation_filters.py +124 -0
- stadiamaps/models/auto_costing_options.py +1 -1
- stadiamaps/models/base_costing_options.py +1 -1
- stadiamaps/models/base_trace_request.py +4 -4
- stadiamaps/models/bicycle_costing_options.py +1 -1
- stadiamaps/models/bike_network.py +1 -1
- stadiamaps/models/bulk_request.py +80 -104
- stadiamaps/models/bulk_request_query.py +138 -0
- stadiamaps/models/bulk_search_response.py +1 -1
- stadiamaps/models/contour.py +1 -1
- stadiamaps/models/coordinate.py +1 -1
- stadiamaps/models/costing_model.py +1 -1
- stadiamaps/models/costing_options.py +1 -1
- stadiamaps/models/directions_options.py +1 -1
- stadiamaps/models/distance_unit.py +1 -1
- stadiamaps/models/edge_sign.py +1 -1
- stadiamaps/models/edge_use.py +1 -1
- stadiamaps/models/end_node.py +4 -4
- stadiamaps/models/extended_directions_options.py +121 -0
- stadiamaps/models/geo_attributes.py +1 -1
- stadiamaps/models/geo_json_geometry.py +1 -1
- stadiamaps/models/geo_json_geometry_base.py +1 -1
- stadiamaps/models/geo_json_line_string.py +1 -1
- stadiamaps/models/geo_json_point.py +1 -1
- stadiamaps/models/geo_json_polygon.py +1 -1
- stadiamaps/models/geocoding_object.py +1 -1
- stadiamaps/models/height_request.py +4 -4
- stadiamaps/models/height_response.py +4 -4
- stadiamaps/models/highway_classification.py +1 -1
- stadiamaps/models/intersecting_edge.py +1 -1
- stadiamaps/models/isochrone_costing_model.py +1 -1
- stadiamaps/models/isochrone_feature.py +1 -1
- stadiamaps/models/isochrone_properties.py +1 -1
- stadiamaps/models/isochrone_request.py +7 -7
- stadiamaps/models/isochrone_response.py +4 -4
- stadiamaps/models/locate_detailed_edge.py +1 -1
- stadiamaps/models/locate_edge.py +1 -1
- stadiamaps/models/locate_edge_info.py +1 -1
- stadiamaps/models/locate_node.py +1 -1
- stadiamaps/models/locate_object.py +17 -7
- stadiamaps/models/low_speed_vehicle_costing_options.py +1 -1
- stadiamaps/models/maneuver_sign.py +13 -13
- stadiamaps/models/maneuver_sign_element.py +1 -1
- stadiamaps/models/map_match_costing_model.py +1 -1
- stadiamaps/models/map_match_request.py +27 -5
- stadiamaps/models/map_match_route_response.py +4 -4
- stadiamaps/models/map_match_trace_options.py +1 -1
- stadiamaps/models/map_match_waypoint.py +1 -1
- stadiamaps/models/matched_point.py +1 -1
- stadiamaps/models/matrix_costing_model.py +1 -1
- stadiamaps/models/matrix_distance.py +1 -1
- stadiamaps/models/matrix_request.py +7 -7
- stadiamaps/models/matrix_response.py +13 -13
- stadiamaps/models/matrix_waypoint.py +1 -1
- stadiamaps/models/motor_scooter_costing_options.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +1 -1
- stadiamaps/models/nearest_roads_request.py +4 -4
- stadiamaps/models/node_id.py +1 -1
- stadiamaps/models/node_type.py +1 -1
- stadiamaps/models/optimized_route_request.py +28 -6
- stadiamaps/models/osrm_admin.py +103 -0
- stadiamaps/models/osrm_annotation.py +117 -0
- stadiamaps/models/osrm_banner_component.py +113 -0
- stadiamaps/models/osrm_banner_content.py +131 -0
- stadiamaps/models/osrm_banner_instruction.py +112 -0
- stadiamaps/models/osrm_base_api_response.py +112 -0
- stadiamaps/models/osrm_guidance_modifier.py +44 -0
- stadiamaps/models/osrm_intersection.py +145 -0
- stadiamaps/models/osrm_lane.py +111 -0
- stadiamaps/models/osrm_route.py +119 -0
- stadiamaps/models/osrm_route_leg.py +148 -0
- stadiamaps/models/osrm_route_response.py +132 -0
- stadiamaps/models/osrm_route_step.py +185 -0
- stadiamaps/models/osrm_speed_limit.py +117 -0
- stadiamaps/models/osrm_step_maneuver.py +127 -0
- stadiamaps/models/osrm_via_waypoint.py +105 -0
- stadiamaps/models/osrm_voice_instruction.py +105 -0
- stadiamaps/models/osrm_waypoint.py +108 -0
- stadiamaps/models/pedestrian_costing_options.py +1 -1
- stadiamaps/models/pelias_geo_json_feature.py +1 -1
- stadiamaps/models/pelias_geo_json_properties.py +1 -1
- stadiamaps/models/pelias_geo_json_properties_addendum.py +1 -1
- stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +1 -1
- stadiamaps/models/pelias_layer.py +1 -1
- stadiamaps/models/pelias_response.py +4 -4
- stadiamaps/models/pelias_source.py +1 -1
- stadiamaps/models/restrictions.py +1 -1
- stadiamaps/models/road_class.py +1 -1
- stadiamaps/models/route200_response.py +138 -0
- stadiamaps/models/route_leg.py +4 -4
- stadiamaps/models/route_maneuver.py +1 -1
- stadiamaps/models/route_request.py +30 -8
- stadiamaps/models/route_response.py +4 -4
- stadiamaps/models/route_response_alternates_inner.py +1 -1
- stadiamaps/models/route_summary.py +1 -1
- stadiamaps/models/route_trip.py +7 -7
- stadiamaps/models/routing_response_waypoint.py +1 -1
- stadiamaps/models/routing_waypoint.py +1 -1
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +1 -1
- stadiamaps/models/search_query.py +1 -1
- stadiamaps/models/search_structured_query.py +1 -1
- stadiamaps/models/simple_routing_waypoint.py +1 -1
- stadiamaps/models/speeds.py +1 -1
- stadiamaps/models/trace_attribute_filter_options.py +1 -1
- stadiamaps/models/trace_attribute_key.py +1 -1
- stadiamaps/models/trace_attributes_base_response.py +15 -10
- stadiamaps/models/trace_attributes_request.py +4 -4
- stadiamaps/models/trace_attributes_response.py +18 -13
- stadiamaps/models/trace_edge.py +2 -2
- stadiamaps/models/travel_mode.py +1 -1
- stadiamaps/models/traversability.py +1 -1
- stadiamaps/models/truck_costing_options.py +1 -1
- stadiamaps/models/tz_response.py +1 -1
- stadiamaps/models/valhalla_languages.py +1 -1
- stadiamaps/models/valhalla_long_units.py +1 -1
- stadiamaps/models/warning.py +1 -1
- stadiamaps/rest.py +1 -1
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.0.dist-info}/METADATA +1 -1
- stadiamaps-4.0.0.dist-info/RECORD +160 -0
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.0.dist-info}/WHEEL +1 -1
- stadiamaps-3.2.0.dist-info/RECORD +0 -138
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-3.2.0.dist-info → stadiamaps-4.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -14,128 +14,104 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
17
|
-
import json
|
18
17
|
import pprint
|
19
|
-
|
20
|
-
|
21
|
-
from stadiamaps.models.search_bulk_query import SearchBulkQuery
|
22
|
-
from stadiamaps.models.search_structured_bulk_query import SearchStructuredBulkQuery
|
23
|
-
from pydantic import StrictStr, Field
|
24
|
-
from typing import Union, List, Set, Optional, Dict
|
25
|
-
from typing_extensions import Literal, Self
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
26
20
|
|
27
|
-
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from stadiamaps.models.bulk_request_query import BulkRequestQuery
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
28
26
|
|
29
27
|
class BulkRequest(BaseModel):
|
30
28
|
"""
|
31
29
|
BulkRequest
|
32
|
-
"""
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
30
|
+
""" # noqa: E501
|
31
|
+
endpoint: Optional[StrictStr] = None
|
32
|
+
query: Optional[BulkRequestQuery] = None
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
34
|
+
__properties: ClassVar[List[str]] = ["endpoint", "query"]
|
35
|
+
|
36
|
+
@field_validator('endpoint')
|
37
|
+
def endpoint_validate_enum(cls, value):
|
38
|
+
"""Validates the enum"""
|
39
|
+
if value is None:
|
40
|
+
return value
|
41
|
+
|
42
|
+
if value not in set(['/v1/search', '/v1/search/structured']):
|
43
|
+
raise ValueError("must be one of enum values ('/v1/search', '/v1/search/structured')")
|
44
|
+
return value
|
39
45
|
|
40
46
|
model_config = ConfigDict(
|
47
|
+
populate_by_name=True,
|
41
48
|
validate_assignment=True,
|
42
49
|
protected_namespaces=(),
|
43
50
|
)
|
44
51
|
|
45
52
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
def __init__(self, *args, **kwargs) -> None:
|
50
|
-
if args:
|
51
|
-
if len(args) > 1:
|
52
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
53
|
-
if kwargs:
|
54
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
55
|
-
super().__init__(actual_instance=args[0])
|
56
|
-
else:
|
57
|
-
super().__init__(**kwargs)
|
58
|
-
|
59
|
-
@field_validator('actual_instance')
|
60
|
-
def actual_instance_must_validate_oneof(cls, v):
|
61
|
-
instance = BulkRequest.model_construct()
|
62
|
-
error_messages = []
|
63
|
-
match = 0
|
64
|
-
# validate data type: SearchBulkQuery
|
65
|
-
if not isinstance(v, SearchBulkQuery):
|
66
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `SearchBulkQuery`")
|
67
|
-
else:
|
68
|
-
match += 1
|
69
|
-
# validate data type: SearchStructuredBulkQuery
|
70
|
-
if not isinstance(v, SearchStructuredBulkQuery):
|
71
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `SearchStructuredBulkQuery`")
|
72
|
-
else:
|
73
|
-
match += 1
|
74
|
-
if match > 1:
|
75
|
-
# more than 1 match
|
76
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in BulkRequest with oneOf schemas: SearchBulkQuery, SearchStructuredBulkQuery. Details: " + ", ".join(error_messages))
|
77
|
-
elif match == 0:
|
78
|
-
# no match
|
79
|
-
raise ValueError("No match found when setting `actual_instance` in BulkRequest with oneOf schemas: SearchBulkQuery, SearchStructuredBulkQuery. Details: " + ", ".join(error_messages))
|
80
|
-
else:
|
81
|
-
return v
|
53
|
+
def to_str(self) -> str:
|
54
|
+
"""Returns the string representation of the model using alias"""
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
82
56
|
|
83
|
-
|
84
|
-
|
85
|
-
|
57
|
+
def to_json(self) -> str:
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
60
|
+
return json.dumps(self.to_dict())
|
86
61
|
|
87
62
|
@classmethod
|
88
|
-
def from_json(cls, json_str: str) -> Self:
|
89
|
-
"""
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
64
|
+
"""Create an instance of BulkRequest from a JSON string"""
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
66
|
+
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
69
|
+
|
70
|
+
This has the following differences from calling pydantic's
|
71
|
+
`self.model_dump(by_alias=True)`:
|
72
|
+
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
74
|
+
were set at model initialization. Other fields with value `None`
|
75
|
+
are ignored.
|
76
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
77
|
+
"""
|
78
|
+
excluded_fields: Set[str] = set([
|
79
|
+
"additional_properties",
|
80
|
+
])
|
81
|
+
|
82
|
+
_dict = self.model_dump(
|
83
|
+
by_alias=True,
|
84
|
+
exclude=excluded_fields,
|
85
|
+
exclude_none=True,
|
86
|
+
)
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of query
|
88
|
+
if self.query:
|
89
|
+
_dict['query'] = self.query.to_dict()
|
90
|
+
# puts key-value pairs in additional_properties in the top level
|
91
|
+
if self.additional_properties is not None:
|
92
|
+
for _key, _value in self.additional_properties.items():
|
93
|
+
_dict[_key] = _value
|
94
|
+
|
95
|
+
return _dict
|
115
96
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
122
|
-
return self.actual_instance.to_json()
|
123
|
-
else:
|
124
|
-
return json.dumps(self.actual_instance)
|
125
|
-
|
126
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], SearchBulkQuery, SearchStructuredBulkQuery]]:
|
127
|
-
"""Returns the dict representation of the actual instance"""
|
128
|
-
if self.actual_instance is None:
|
97
|
+
@classmethod
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
99
|
+
"""Create an instance of BulkRequest from a dict"""
|
100
|
+
if obj is None:
|
129
101
|
return None
|
130
102
|
|
131
|
-
if
|
132
|
-
return
|
133
|
-
else:
|
134
|
-
# primitive type
|
135
|
-
return self.actual_instance
|
103
|
+
if not isinstance(obj, dict):
|
104
|
+
return cls.model_validate(obj)
|
136
105
|
|
137
|
-
|
138
|
-
|
139
|
-
|
106
|
+
_obj = cls.model_validate({
|
107
|
+
"endpoint": obj.get("endpoint"),
|
108
|
+
"query": BulkRequestQuery.from_dict(obj["query"]) if obj.get("query") is not None else None
|
109
|
+
})
|
110
|
+
# store additional fields in additional_properties
|
111
|
+
for _key in obj.keys():
|
112
|
+
if _key not in cls.__properties:
|
113
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
114
|
+
|
115
|
+
return _obj
|
140
116
|
|
141
117
|
|
@@ -0,0 +1,138 @@
|
|
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: 7.0.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 json
|
18
|
+
import pprint
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
20
|
+
from typing import Any, List, Optional
|
21
|
+
from stadiamaps.models.search_query import SearchQuery
|
22
|
+
from stadiamaps.models.search_structured_query import SearchStructuredQuery
|
23
|
+
from pydantic import StrictStr, Field
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
25
|
+
from typing_extensions import Literal, Self
|
26
|
+
|
27
|
+
BULKREQUESTQUERY_ONE_OF_SCHEMAS = ["SearchQuery", "SearchStructuredQuery"]
|
28
|
+
|
29
|
+
class BulkRequestQuery(BaseModel):
|
30
|
+
"""
|
31
|
+
BulkRequestQuery
|
32
|
+
"""
|
33
|
+
# data type: SearchQuery
|
34
|
+
oneof_schema_1_validator: Optional[SearchQuery] = None
|
35
|
+
# data type: SearchStructuredQuery
|
36
|
+
oneof_schema_2_validator: Optional[SearchStructuredQuery] = None
|
37
|
+
actual_instance: Optional[Union[SearchQuery, SearchStructuredQuery]] = None
|
38
|
+
one_of_schemas: Set[str] = { "SearchQuery", "SearchStructuredQuery" }
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
validate_assignment=True,
|
42
|
+
protected_namespaces=(),
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
def __init__(self, *args, **kwargs) -> None:
|
47
|
+
if args:
|
48
|
+
if len(args) > 1:
|
49
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
50
|
+
if kwargs:
|
51
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
52
|
+
super().__init__(actual_instance=args[0])
|
53
|
+
else:
|
54
|
+
super().__init__(**kwargs)
|
55
|
+
|
56
|
+
@field_validator('actual_instance')
|
57
|
+
def actual_instance_must_validate_oneof(cls, v):
|
58
|
+
instance = BulkRequestQuery.model_construct()
|
59
|
+
error_messages = []
|
60
|
+
match = 0
|
61
|
+
# validate data type: SearchQuery
|
62
|
+
if not isinstance(v, SearchQuery):
|
63
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SearchQuery`")
|
64
|
+
else:
|
65
|
+
match += 1
|
66
|
+
# validate data type: SearchStructuredQuery
|
67
|
+
if not isinstance(v, SearchStructuredQuery):
|
68
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SearchStructuredQuery`")
|
69
|
+
else:
|
70
|
+
match += 1
|
71
|
+
if match > 1:
|
72
|
+
# more than 1 match
|
73
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in BulkRequestQuery with oneOf schemas: SearchQuery, SearchStructuredQuery. Details: " + ", ".join(error_messages))
|
74
|
+
elif match == 0:
|
75
|
+
# no match
|
76
|
+
raise ValueError("No match found when setting `actual_instance` in BulkRequestQuery with oneOf schemas: SearchQuery, SearchStructuredQuery. Details: " + ", ".join(error_messages))
|
77
|
+
else:
|
78
|
+
return v
|
79
|
+
|
80
|
+
@classmethod
|
81
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
82
|
+
return cls.from_json(json.dumps(obj))
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def from_json(cls, json_str: str) -> Self:
|
86
|
+
"""Returns the object represented by the json string"""
|
87
|
+
instance = cls.model_construct()
|
88
|
+
error_messages = []
|
89
|
+
match = 0
|
90
|
+
|
91
|
+
# deserialize data into SearchQuery
|
92
|
+
try:
|
93
|
+
instance.actual_instance = SearchQuery.from_json(json_str)
|
94
|
+
match += 1
|
95
|
+
except (ValidationError, ValueError) as e:
|
96
|
+
error_messages.append(str(e))
|
97
|
+
# deserialize data into SearchStructuredQuery
|
98
|
+
try:
|
99
|
+
instance.actual_instance = SearchStructuredQuery.from_json(json_str)
|
100
|
+
match += 1
|
101
|
+
except (ValidationError, ValueError) as e:
|
102
|
+
error_messages.append(str(e))
|
103
|
+
|
104
|
+
if match > 1:
|
105
|
+
# more than 1 match
|
106
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into BulkRequestQuery with oneOf schemas: SearchQuery, SearchStructuredQuery. Details: " + ", ".join(error_messages))
|
107
|
+
elif match == 0:
|
108
|
+
# no match
|
109
|
+
raise ValueError("No match found when deserializing the JSON string into BulkRequestQuery with oneOf schemas: SearchQuery, SearchStructuredQuery. Details: " + ", ".join(error_messages))
|
110
|
+
else:
|
111
|
+
return instance
|
112
|
+
|
113
|
+
def to_json(self) -> str:
|
114
|
+
"""Returns the JSON representation of the actual instance"""
|
115
|
+
if self.actual_instance is None:
|
116
|
+
return "null"
|
117
|
+
|
118
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
119
|
+
return self.actual_instance.to_json()
|
120
|
+
else:
|
121
|
+
return json.dumps(self.actual_instance)
|
122
|
+
|
123
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], SearchQuery, SearchStructuredQuery]]:
|
124
|
+
"""Returns the dict representation of the actual instance"""
|
125
|
+
if self.actual_instance is None:
|
126
|
+
return None
|
127
|
+
|
128
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
129
|
+
return self.actual_instance.to_dict()
|
130
|
+
else:
|
131
|
+
# primitive type
|
132
|
+
return self.actual_instance
|
133
|
+
|
134
|
+
def to_str(self) -> str:
|
135
|
+
"""Returns the string representation of the actual instance"""
|
136
|
+
return pprint.pformat(self.model_dump())
|
137
|
+
|
138
|
+
|
@@ -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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/contour.py
CHANGED
@@ -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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/coordinate.py
CHANGED
@@ -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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/edge_sign.py
CHANGED
@@ -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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/edge_use.py
CHANGED
@@ -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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/end_node.py
CHANGED
@@ -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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -82,9 +82,9 @@ class EndNode(BaseModel):
|
|
82
82
|
# override the default output from pydantic by calling `to_dict()` of each item in intersecting_edges (list)
|
83
83
|
_items = []
|
84
84
|
if self.intersecting_edges:
|
85
|
-
for
|
86
|
-
if
|
87
|
-
_items.append(
|
85
|
+
for _item_intersecting_edges in self.intersecting_edges:
|
86
|
+
if _item_intersecting_edges:
|
87
|
+
_items.append(_item_intersecting_edges.to_dict())
|
88
88
|
_dict['intersecting_edges'] = _items
|
89
89
|
# puts key-value pairs in additional_properties in the top level
|
90
90
|
if self.additional_properties is not None:
|
@@ -0,0 +1,121 @@
|
|
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: 7.0.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, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from stadiamaps.models.annotation_filters import AnnotationFilters
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class ExtendedDirectionsOptions(BaseModel):
|
28
|
+
"""
|
29
|
+
ExtendedDirectionsOptions
|
30
|
+
""" # noqa: E501
|
31
|
+
format: Optional[StrictStr] = Field(default=None, description="The output response format. The default JSON format is extremely compact and ideal for web or data-constrained use cases where you want to fetch additional attributes on demand in small chunks. The OSRM format is much richer and is configurable with significantly more info for turn-by-turn navigation use cases.")
|
32
|
+
banner_instructions: Optional[StrictBool] = Field(default=None, description="Optionally includes helpful banners with timing information for turn-by-turn navigation. This is only available in the OSRM format.")
|
33
|
+
voice_instructions: Optional[StrictBool] = Field(default=None, description="Optionally includes voice instructions with timing information for turn-by-turn navigation. This is only available in the OSRM format.")
|
34
|
+
filters: Optional[AnnotationFilters] = None
|
35
|
+
additional_properties: Dict[str, Any] = {}
|
36
|
+
__properties: ClassVar[List[str]] = ["format", "banner_instructions", "voice_instructions", "filters"]
|
37
|
+
|
38
|
+
@field_validator('format')
|
39
|
+
def format_validate_enum(cls, value):
|
40
|
+
"""Validates the enum"""
|
41
|
+
if value is None:
|
42
|
+
return value
|
43
|
+
|
44
|
+
if value not in set(['json', 'osrm']):
|
45
|
+
raise ValueError("must be one of enum values ('json', 'osrm')")
|
46
|
+
return value
|
47
|
+
|
48
|
+
model_config = ConfigDict(
|
49
|
+
populate_by_name=True,
|
50
|
+
validate_assignment=True,
|
51
|
+
protected_namespaces=(),
|
52
|
+
)
|
53
|
+
|
54
|
+
|
55
|
+
def to_str(self) -> str:
|
56
|
+
"""Returns the string representation of the model using alias"""
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
58
|
+
|
59
|
+
def to_json(self) -> str:
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
62
|
+
return json.dumps(self.to_dict())
|
63
|
+
|
64
|
+
@classmethod
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
66
|
+
"""Create an instance of ExtendedDirectionsOptions from a JSON string"""
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
68
|
+
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
71
|
+
|
72
|
+
This has the following differences from calling pydantic's
|
73
|
+
`self.model_dump(by_alias=True)`:
|
74
|
+
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
76
|
+
were set at model initialization. Other fields with value `None`
|
77
|
+
are ignored.
|
78
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
79
|
+
"""
|
80
|
+
excluded_fields: Set[str] = set([
|
81
|
+
"additional_properties",
|
82
|
+
])
|
83
|
+
|
84
|
+
_dict = self.model_dump(
|
85
|
+
by_alias=True,
|
86
|
+
exclude=excluded_fields,
|
87
|
+
exclude_none=True,
|
88
|
+
)
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of filters
|
90
|
+
if self.filters:
|
91
|
+
_dict['filters'] = self.filters.to_dict()
|
92
|
+
# puts key-value pairs in additional_properties in the top level
|
93
|
+
if self.additional_properties is not None:
|
94
|
+
for _key, _value in self.additional_properties.items():
|
95
|
+
_dict[_key] = _value
|
96
|
+
|
97
|
+
return _dict
|
98
|
+
|
99
|
+
@classmethod
|
100
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
101
|
+
"""Create an instance of ExtendedDirectionsOptions from a dict"""
|
102
|
+
if obj is None:
|
103
|
+
return None
|
104
|
+
|
105
|
+
if not isinstance(obj, dict):
|
106
|
+
return cls.model_validate(obj)
|
107
|
+
|
108
|
+
_obj = cls.model_validate({
|
109
|
+
"format": obj.get("format"),
|
110
|
+
"banner_instructions": obj.get("banner_instructions"),
|
111
|
+
"voice_instructions": obj.get("voice_instructions"),
|
112
|
+
"filters": AnnotationFilters.from_dict(obj["filters"]) if obj.get("filters") is not None else None
|
113
|
+
})
|
114
|
+
# store additional fields in additional_properties
|
115
|
+
for _key in obj.keys():
|
116
|
+
if _key not in cls.__properties:
|
117
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
118
|
+
|
119
|
+
return _obj
|
120
|
+
|
121
|
+
|
@@ -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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.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:
|
8
|
+
The version of the OpenAPI document: 7.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|