stadiamaps 3.1.0__py3-none-any.whl → 3.2.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 +8 -2
- stadiamaps/api/geocoding_api.py +384 -101
- stadiamaps/api/geospatial_api.py +13 -11
- stadiamaps/api/routing_api.py +46 -39
- stadiamaps/api_client.py +22 -11
- stadiamaps/configuration.py +19 -5
- stadiamaps/exceptions.py +1 -1
- stadiamaps/models/__init__.py +7 -1
- stadiamaps/models/access.py +1 -1
- stadiamaps/models/admin_region.py +1 -1
- stadiamaps/models/administrative.py +1 -1
- stadiamaps/models/auto_costing_options.py +1 -1
- stadiamaps/models/base_costing_options.py +1 -1
- stadiamaps/models/base_trace_request.py +5 -5
- stadiamaps/models/bicycle_costing_options.py +1 -1
- stadiamaps/models/bike_network.py +1 -1
- stadiamaps/models/bulk_request.py +141 -0
- stadiamaps/models/bulk_search_request_inner.py +141 -0
- stadiamaps/models/bulk_search_response.py +109 -0
- 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 +5 -5
- 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 +1 -1
- 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 +1 -1
- stadiamaps/models/height_response.py +1 -1
- stadiamaps/models/highway_classification.py +1 -1
- stadiamaps/models/intersecting_edge.py +1 -1
- stadiamaps/models/isochrone_costing_model.py +8 -1
- stadiamaps/models/isochrone_feature.py +1 -1
- stadiamaps/models/isochrone_properties.py +1 -1
- stadiamaps/models/isochrone_request.py +1 -1
- stadiamaps/models/isochrone_response.py +1 -1
- 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 +1 -1
- stadiamaps/models/low_speed_vehicle_costing_options.py +1 -1
- stadiamaps/models/maneuver_sign.py +1 -1
- stadiamaps/models/maneuver_sign_element.py +1 -1
- stadiamaps/models/map_match_costing_model.py +8 -2
- stadiamaps/models/map_match_request.py +5 -5
- stadiamaps/models/map_match_route_response.py +1 -1
- 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 +5 -5
- stadiamaps/models/matrix_response.py +2 -2
- 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 +5 -5
- stadiamaps/models/node_id.py +1 -1
- stadiamaps/models/node_type.py +1 -1
- stadiamaps/models/optimized_route_request.py +5 -5
- stadiamaps/models/pedestrian_costing_options.py +1 -1
- stadiamaps/models/pelias_geo_json_feature.py +3 -5
- stadiamaps/models/pelias_geo_json_properties.py +2 -2
- 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 +1 -1
- stadiamaps/models/pelias_source.py +1 -1
- stadiamaps/models/restrictions.py +1 -1
- stadiamaps/models/road_class.py +1 -1
- stadiamaps/models/route_leg.py +2 -2
- stadiamaps/models/route_maneuver.py +1 -1
- stadiamaps/models/route_request.py +5 -5
- stadiamaps/models/route_response.py +1 -1
- stadiamaps/models/route_response_alternates_inner.py +1 -1
- stadiamaps/models/route_summary.py +1 -1
- stadiamaps/models/route_trip.py +3 -3
- 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_bulk_query.py +117 -0
- stadiamaps/models/search_bulk_request.py +141 -0
- stadiamaps/models/search_query.py +134 -0
- stadiamaps/models/search_structured_bulk_query.py +117 -0
- stadiamaps/models/search_structured_query.py +148 -0
- 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 +1 -1
- stadiamaps/models/trace_attributes_request.py +5 -5
- stadiamaps/models/trace_attributes_response.py +3 -3
- stadiamaps/models/trace_edge.py +1 -1
- 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.1.0.dist-info → stadiamaps-3.2.0.dist-info}/METADATA +1 -1
- stadiamaps-3.2.0.dist-info/RECORD +138 -0
- {stadiamaps-3.1.0.dist-info → stadiamaps-3.2.0.dist-info}/WHEEL +1 -1
- stadiamaps-3.1.0.dist-info/RECORD +0 -130
- {stadiamaps-3.1.0.dist-info → stadiamaps-3.2.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-3.1.0.dist-info → stadiamaps-3.2.0.dist-info}/top_level.txt +0 -0
stadiamaps/api/geospatial_api.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: 6.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -273,11 +273,12 @@ class GeospatialApi:
|
|
273
273
|
|
274
274
|
|
275
275
|
# set the HTTP header `Accept`
|
276
|
-
|
277
|
-
[
|
278
|
-
|
279
|
-
|
280
|
-
|
276
|
+
if 'Accept' not in _header_params:
|
277
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
278
|
+
[
|
279
|
+
'application/json'
|
280
|
+
]
|
281
|
+
)
|
281
282
|
|
282
283
|
# set the HTTP header `Content-Type`
|
283
284
|
if _content_type:
|
@@ -583,11 +584,12 @@ class GeospatialApi:
|
|
583
584
|
|
584
585
|
|
585
586
|
# set the HTTP header `Accept`
|
586
|
-
|
587
|
-
[
|
588
|
-
|
589
|
-
|
590
|
-
|
587
|
+
if 'Accept' not in _header_params:
|
588
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
589
|
+
[
|
590
|
+
'application/json'
|
591
|
+
]
|
592
|
+
)
|
591
593
|
|
592
594
|
|
593
595
|
# authentication setting
|
stadiamaps/api/routing_api.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: 6.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -69,7 +69,7 @@ class RoutingApi:
|
|
69
69
|
) -> IsochroneResponse:
|
70
70
|
"""Calculate areas of equal travel time from a location.
|
71
71
|
|
72
|
-
The isochrone API
|
72
|
+
The isochrone API computes reachable areas within a time or distance constraint. The resulting polygon can be rendered on a map and used for assessing urban mobility, planning, or as a search filter of places within a constrained range.
|
73
73
|
|
74
74
|
:param isochrone_request:
|
75
75
|
:type isochrone_request: IsochroneRequest
|
@@ -137,7 +137,7 @@ class RoutingApi:
|
|
137
137
|
) -> ApiResponse[IsochroneResponse]:
|
138
138
|
"""Calculate areas of equal travel time from a location.
|
139
139
|
|
140
|
-
The isochrone API
|
140
|
+
The isochrone API computes reachable areas within a time or distance constraint. The resulting polygon can be rendered on a map and used for assessing urban mobility, planning, or as a search filter of places within a constrained range.
|
141
141
|
|
142
142
|
:param isochrone_request:
|
143
143
|
:type isochrone_request: IsochroneRequest
|
@@ -205,7 +205,7 @@ class RoutingApi:
|
|
205
205
|
) -> RESTResponseType:
|
206
206
|
"""Calculate areas of equal travel time from a location.
|
207
207
|
|
208
|
-
The isochrone API
|
208
|
+
The isochrone API computes reachable areas within a time or distance constraint. The resulting polygon can be rendered on a map and used for assessing urban mobility, planning, or as a search filter of places within a constrained range.
|
209
209
|
|
210
210
|
:param isochrone_request:
|
211
211
|
:type isochrone_request: IsochroneRequest
|
@@ -281,11 +281,12 @@ class RoutingApi:
|
|
281
281
|
|
282
282
|
|
283
283
|
# set the HTTP header `Accept`
|
284
|
-
|
285
|
-
[
|
286
|
-
|
287
|
-
|
288
|
-
|
284
|
+
if 'Accept' not in _header_params:
|
285
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
286
|
+
[
|
287
|
+
'application/json'
|
288
|
+
]
|
289
|
+
)
|
289
290
|
|
290
291
|
# set the HTTP header `Content-Type`
|
291
292
|
if _content_type:
|
@@ -558,11 +559,12 @@ class RoutingApi:
|
|
558
559
|
|
559
560
|
|
560
561
|
# set the HTTP header `Accept`
|
561
|
-
|
562
|
-
[
|
563
|
-
|
564
|
-
|
565
|
-
|
562
|
+
if 'Accept' not in _header_params:
|
563
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
564
|
+
[
|
565
|
+
'application/json'
|
566
|
+
]
|
567
|
+
)
|
566
568
|
|
567
569
|
# set the HTTP header `Content-Type`
|
568
570
|
if _content_type:
|
@@ -832,11 +834,12 @@ class RoutingApi:
|
|
832
834
|
|
833
835
|
|
834
836
|
# set the HTTP header `Accept`
|
835
|
-
|
836
|
-
[
|
837
|
-
|
838
|
-
|
839
|
-
|
837
|
+
if 'Accept' not in _header_params:
|
838
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
839
|
+
[
|
840
|
+
'application/json'
|
841
|
+
]
|
842
|
+
)
|
840
843
|
|
841
844
|
# set the HTTP header `Content-Type`
|
842
845
|
if _content_type:
|
@@ -1109,11 +1112,12 @@ class RoutingApi:
|
|
1109
1112
|
|
1110
1113
|
|
1111
1114
|
# set the HTTP header `Accept`
|
1112
|
-
|
1113
|
-
[
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1115
|
+
if 'Accept' not in _header_params:
|
1116
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1117
|
+
[
|
1118
|
+
'application/json'
|
1119
|
+
]
|
1120
|
+
)
|
1117
1121
|
|
1118
1122
|
# set the HTTP header `Content-Type`
|
1119
1123
|
if _content_type:
|
@@ -1386,11 +1390,12 @@ class RoutingApi:
|
|
1386
1390
|
|
1387
1391
|
|
1388
1392
|
# set the HTTP header `Accept`
|
1389
|
-
|
1390
|
-
[
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1393
|
+
if 'Accept' not in _header_params:
|
1394
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1395
|
+
[
|
1396
|
+
'application/json'
|
1397
|
+
]
|
1398
|
+
)
|
1394
1399
|
|
1395
1400
|
# set the HTTP header `Content-Type`
|
1396
1401
|
if _content_type:
|
@@ -1660,11 +1665,12 @@ class RoutingApi:
|
|
1660
1665
|
|
1661
1666
|
|
1662
1667
|
# set the HTTP header `Accept`
|
1663
|
-
|
1664
|
-
[
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
+
if 'Accept' not in _header_params:
|
1669
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1670
|
+
[
|
1671
|
+
'application/json'
|
1672
|
+
]
|
1673
|
+
)
|
1668
1674
|
|
1669
1675
|
# set the HTTP header `Content-Type`
|
1670
1676
|
if _content_type:
|
@@ -1934,11 +1940,12 @@ class RoutingApi:
|
|
1934
1940
|
|
1935
1941
|
|
1936
1942
|
# set the HTTP header `Accept`
|
1937
|
-
|
1938
|
-
[
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1943
|
+
if 'Accept' not in _header_params:
|
1944
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1945
|
+
[
|
1946
|
+
'application/json'
|
1947
|
+
]
|
1948
|
+
)
|
1942
1949
|
|
1943
1950
|
# set the HTTP header `Content-Type`
|
1944
1951
|
if _content_type:
|
stadiamaps/api_client.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: 6.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -89,7 +89,7 @@ class ApiClient:
|
|
89
89
|
self.default_headers[header_name] = header_value
|
90
90
|
self.cookie = cookie
|
91
91
|
# Set default User-Agent.
|
92
|
-
self.user_agent = 'OpenAPI-Generator/3.
|
92
|
+
self.user_agent = 'OpenAPI-Generator/3.2.0/python'
|
93
93
|
self.client_side_validation = configuration.client_side_validation
|
94
94
|
|
95
95
|
def __enter__(self):
|
@@ -228,7 +228,7 @@ class ApiClient:
|
|
228
228
|
body = self.sanitize_for_serialization(body)
|
229
229
|
|
230
230
|
# request url
|
231
|
-
if _host is None:
|
231
|
+
if _host is None or self.configuration.ignore_operation_servers:
|
232
232
|
url = self.configuration.host + resource_path
|
233
233
|
else:
|
234
234
|
# use server/host defined in path or operation instead
|
@@ -315,10 +315,7 @@ class ApiClient:
|
|
315
315
|
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
316
316
|
encoding = match.group(1) if match else "utf-8"
|
317
317
|
response_text = response_data.data.decode(encoding)
|
318
|
-
|
319
|
-
return_data = self.__deserialize_primitive(response_text, response_type)
|
320
|
-
else:
|
321
|
-
return_data = self.deserialize(response_text, response_type)
|
318
|
+
return_data = self.deserialize(response_text, response_type, content_type)
|
322
319
|
finally:
|
323
320
|
if not 200 <= response_data.status <= 299:
|
324
321
|
raise ApiException.from_response(
|
@@ -386,21 +383,35 @@ class ApiClient:
|
|
386
383
|
for key, val in obj_dict.items()
|
387
384
|
}
|
388
385
|
|
389
|
-
def deserialize(self, response_text, response_type):
|
386
|
+
def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
|
390
387
|
"""Deserializes response into an object.
|
391
388
|
|
392
389
|
:param response: RESTResponse object to be deserialized.
|
393
390
|
:param response_type: class literal for
|
394
391
|
deserialized object, or string of class name.
|
392
|
+
:param content_type: content type of response.
|
395
393
|
|
396
394
|
:return: deserialized object.
|
397
395
|
"""
|
398
396
|
|
399
397
|
# fetch data from response object
|
400
|
-
|
401
|
-
|
402
|
-
|
398
|
+
if content_type is None:
|
399
|
+
try:
|
400
|
+
data = json.loads(response_text)
|
401
|
+
except ValueError:
|
402
|
+
data = response_text
|
403
|
+
elif content_type.startswith("application/json"):
|
404
|
+
if response_text == "":
|
405
|
+
data = ""
|
406
|
+
else:
|
407
|
+
data = json.loads(response_text)
|
408
|
+
elif content_type.startswith("text/plain"):
|
403
409
|
data = response_text
|
410
|
+
else:
|
411
|
+
raise ApiException(
|
412
|
+
status=0,
|
413
|
+
reason="Unsupported content type: {0}".format(content_type)
|
414
|
+
)
|
404
415
|
|
405
416
|
return self.__deserialize(data, response_type)
|
406
417
|
|
stadiamaps/configuration.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: 6.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -33,6 +33,9 @@ class Configuration:
|
|
33
33
|
"""This class contains various settings of the API client.
|
34
34
|
|
35
35
|
:param host: Base url.
|
36
|
+
:param ignore_operation_servers
|
37
|
+
Boolean to ignore operation servers for the API client.
|
38
|
+
Config will use `host` as the base url regardless of the operation servers.
|
36
39
|
:param api_key: Dict to store API key(s).
|
37
40
|
Each entry in the dict specifies an API key.
|
38
41
|
The dict key is the name of the security scheme in the OAS specification.
|
@@ -55,6 +58,7 @@ class Configuration:
|
|
55
58
|
values before.
|
56
59
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
57
60
|
in PEM format.
|
61
|
+
:param retries: Number of retries for API requests.
|
58
62
|
|
59
63
|
:Example:
|
60
64
|
|
@@ -86,7 +90,11 @@ conf = stadiamaps.Configuration(
|
|
86
90
|
access_token=None,
|
87
91
|
server_index=None, server_variables=None,
|
88
92
|
server_operation_index=None, server_operation_variables=None,
|
93
|
+
ignore_operation_servers=False,
|
89
94
|
ssl_ca_cert=None,
|
95
|
+
retries=None,
|
96
|
+
*,
|
97
|
+
debug: Optional[bool] = None
|
90
98
|
) -> None:
|
91
99
|
"""Constructor
|
92
100
|
"""
|
@@ -101,6 +109,9 @@ conf = stadiamaps.Configuration(
|
|
101
109
|
self.server_operation_variables = server_operation_variables or {}
|
102
110
|
"""Default server variables
|
103
111
|
"""
|
112
|
+
self.ignore_operation_servers = ignore_operation_servers
|
113
|
+
"""Ignore operation servers
|
114
|
+
"""
|
104
115
|
self.temp_folder_path = None
|
105
116
|
"""Temp file folder for downloading files
|
106
117
|
"""
|
@@ -144,7 +155,10 @@ conf = stadiamaps.Configuration(
|
|
144
155
|
self.logger_file = None
|
145
156
|
"""Debug file location
|
146
157
|
"""
|
147
|
-
|
158
|
+
if debug is not None:
|
159
|
+
self.debug = debug
|
160
|
+
else:
|
161
|
+
self.__debug = False
|
148
162
|
"""Debug switch
|
149
163
|
"""
|
150
164
|
|
@@ -187,7 +201,7 @@ conf = stadiamaps.Configuration(
|
|
187
201
|
self.safe_chars_for_path_param = ''
|
188
202
|
"""Safe chars for path_param
|
189
203
|
"""
|
190
|
-
self.retries =
|
204
|
+
self.retries = retries
|
191
205
|
"""Adding retries to override urllib3 default value 3
|
192
206
|
"""
|
193
207
|
# Enable client side validation
|
@@ -399,8 +413,8 @@ conf = stadiamaps.Configuration(
|
|
399
413
|
return "Python SDK Debug Report:\n"\
|
400
414
|
"OS: {env}\n"\
|
401
415
|
"Python Version: {pyversion}\n"\
|
402
|
-
"Version of the API: 6.
|
403
|
-
"SDK Package Version: 3.
|
416
|
+
"Version of the API: 6.6.2\n"\
|
417
|
+
"SDK Package Version: 3.2.0".\
|
404
418
|
format(env=sys.platform, pyversion=sys.version)
|
405
419
|
|
406
420
|
def get_host_settings(self):
|
stadiamaps/exceptions.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: 6.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/__init__.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
8
8
|
|
9
|
-
The version of the OpenAPI document: 6.
|
9
|
+
The version of the OpenAPI document: 6.6.2
|
10
10
|
Contact: support@stadiamaps.com
|
11
11
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
12
12
|
|
@@ -23,6 +23,8 @@ from stadiamaps.models.base_costing_options import BaseCostingOptions
|
|
23
23
|
from stadiamaps.models.base_trace_request import BaseTraceRequest
|
24
24
|
from stadiamaps.models.bicycle_costing_options import BicycleCostingOptions
|
25
25
|
from stadiamaps.models.bike_network import BikeNetwork
|
26
|
+
from stadiamaps.models.bulk_request import BulkRequest
|
27
|
+
from stadiamaps.models.bulk_search_response import BulkSearchResponse
|
26
28
|
from stadiamaps.models.contour import Contour
|
27
29
|
from stadiamaps.models.coordinate import Coordinate
|
28
30
|
from stadiamaps.models.costing_model import CostingModel
|
@@ -93,6 +95,10 @@ from stadiamaps.models.route_trip import RouteTrip
|
|
93
95
|
from stadiamaps.models.routing_response_waypoint import RoutingResponseWaypoint
|
94
96
|
from stadiamaps.models.routing_waypoint import RoutingWaypoint
|
95
97
|
from stadiamaps.models.routing_waypoint_all_of_search_filter import RoutingWaypointAllOfSearchFilter
|
98
|
+
from stadiamaps.models.search_bulk_query import SearchBulkQuery
|
99
|
+
from stadiamaps.models.search_query import SearchQuery
|
100
|
+
from stadiamaps.models.search_structured_bulk_query import SearchStructuredBulkQuery
|
101
|
+
from stadiamaps.models.search_structured_query import SearchStructuredQuery
|
96
102
|
from stadiamaps.models.simple_routing_waypoint import SimpleRoutingWaypoint
|
97
103
|
from stadiamaps.models.speeds import Speeds
|
98
104
|
from stadiamaps.models.trace_attribute_filter_options import TraceAttributeFilterOptions
|
stadiamaps/models/access.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: 6.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
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.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
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.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
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.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
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.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
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.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -32,8 +32,8 @@ class BaseTraceRequest(BaseModel):
|
|
32
32
|
"""
|
33
33
|
BaseTraceRequest
|
34
34
|
""" # noqa: E501
|
35
|
-
units: Optional[DistanceUnit] =
|
36
|
-
language: Optional[ValhallaLanguages] =
|
35
|
+
units: Optional[DistanceUnit] = DistanceUnit.KM
|
36
|
+
language: Optional[ValhallaLanguages] = ValhallaLanguages.EN_MINUS_US
|
37
37
|
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.")
|
38
38
|
id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
|
39
39
|
shape: Optional[List[MapMatchWaypoint]] = Field(default=None, description="REQUIRED if `encoded_polyline` is not present. Note that `break` type locations are only supported when `shape_match` is set to `map_match`.")
|
@@ -132,8 +132,8 @@ class BaseTraceRequest(BaseModel):
|
|
132
132
|
return cls.model_validate(obj)
|
133
133
|
|
134
134
|
_obj = cls.model_validate({
|
135
|
-
"units": obj.get("units"),
|
136
|
-
"language": obj.get("language"),
|
135
|
+
"units": obj.get("units") if obj.get("units") is not None else DistanceUnit.KM,
|
136
|
+
"language": obj.get("language") if obj.get("language") is not None else ValhallaLanguages.EN_MINUS_US,
|
137
137
|
"directions_type": obj.get("directions_type") if obj.get("directions_type") is not None else 'instructions',
|
138
138
|
"id": obj.get("id"),
|
139
139
|
"shape": [MapMatchWaypoint.from_dict(_item) for _item in obj["shape"]] if obj.get("shape") is not None else None,
|
@@ -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.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
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.
|
8
|
+
The version of the OpenAPI document: 6.6.2
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -0,0 +1,141 @@
|
|
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.6.2
|
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_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
|
26
|
+
|
27
|
+
BULKREQUEST_ONE_OF_SCHEMAS = ["SearchBulkQuery", "SearchStructuredBulkQuery"]
|
28
|
+
|
29
|
+
class BulkRequest(BaseModel):
|
30
|
+
"""
|
31
|
+
BulkRequest
|
32
|
+
"""
|
33
|
+
# data type: SearchBulkQuery
|
34
|
+
oneof_schema_1_validator: Optional[SearchBulkQuery] = None
|
35
|
+
# data type: SearchStructuredBulkQuery
|
36
|
+
oneof_schema_2_validator: Optional[SearchStructuredBulkQuery] = None
|
37
|
+
actual_instance: Optional[Union[SearchBulkQuery, SearchStructuredBulkQuery]] = None
|
38
|
+
one_of_schemas: Set[str] = { "SearchBulkQuery", "SearchStructuredBulkQuery" }
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
validate_assignment=True,
|
42
|
+
protected_namespaces=(),
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
discriminator_value_class_map: Dict[str, str] = {
|
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
|
82
|
+
|
83
|
+
@classmethod
|
84
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
85
|
+
return cls.from_json(json.dumps(obj))
|
86
|
+
|
87
|
+
@classmethod
|
88
|
+
def from_json(cls, json_str: str) -> Self:
|
89
|
+
"""Returns the object represented by the json string"""
|
90
|
+
instance = cls.model_construct()
|
91
|
+
error_messages = []
|
92
|
+
match = 0
|
93
|
+
|
94
|
+
# deserialize data into SearchBulkQuery
|
95
|
+
try:
|
96
|
+
instance.actual_instance = SearchBulkQuery.from_json(json_str)
|
97
|
+
match += 1
|
98
|
+
except (ValidationError, ValueError) as e:
|
99
|
+
error_messages.append(str(e))
|
100
|
+
# deserialize data into SearchStructuredBulkQuery
|
101
|
+
try:
|
102
|
+
instance.actual_instance = SearchStructuredBulkQuery.from_json(json_str)
|
103
|
+
match += 1
|
104
|
+
except (ValidationError, ValueError) as e:
|
105
|
+
error_messages.append(str(e))
|
106
|
+
|
107
|
+
if match > 1:
|
108
|
+
# more than 1 match
|
109
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into BulkRequest with oneOf schemas: SearchBulkQuery, SearchStructuredBulkQuery. Details: " + ", ".join(error_messages))
|
110
|
+
elif match == 0:
|
111
|
+
# no match
|
112
|
+
raise ValueError("No match found when deserializing the JSON string into BulkRequest with oneOf schemas: SearchBulkQuery, SearchStructuredBulkQuery. Details: " + ", ".join(error_messages))
|
113
|
+
else:
|
114
|
+
return instance
|
115
|
+
|
116
|
+
def to_json(self) -> str:
|
117
|
+
"""Returns the JSON representation of the actual instance"""
|
118
|
+
if self.actual_instance is None:
|
119
|
+
return "null"
|
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:
|
129
|
+
return None
|
130
|
+
|
131
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
132
|
+
return self.actual_instance.to_dict()
|
133
|
+
else:
|
134
|
+
# primitive type
|
135
|
+
return self.actual_instance
|
136
|
+
|
137
|
+
def to_str(self) -> str:
|
138
|
+
"""Returns the string representation of the actual instance"""
|
139
|
+
return pprint.pformat(self.model_dump())
|
140
|
+
|
141
|
+
|