stadiamaps 3.0.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 +389 -106
- stadiamaps/api/geospatial_api.py +15 -13
- stadiamaps/api/routing_api.py +57 -50
- stadiamaps/api_client.py +54 -33
- 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 +3 -3
- 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 +4 -4
- 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 +9 -5
- stadiamaps/models/route_maneuver.py +1 -1
- stadiamaps/models/route_request.py +12 -8
- 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 +3 -1
- {stadiamaps-3.0.0.dist-info → stadiamaps-3.2.0.dist-info}/METADATA +1 -1
- stadiamaps-3.2.0.dist-info/RECORD +138 -0
- {stadiamaps-3.0.0.dist-info → stadiamaps-3.2.0.dist-info}/WHEEL +1 -1
- stadiamaps-3.0.0.dist-info/RECORD +0 -130
- {stadiamaps-3.0.0.dist-info → stadiamaps-3.2.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-3.0.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
|
|
@@ -260,7 +260,7 @@ class GeospatialApi:
|
|
260
260
|
_query_params: List[Tuple[str, str]] = []
|
261
261
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
262
262
|
_form_params: List[Tuple[str, str]] = []
|
263
|
-
_files: Dict[str, str] = {}
|
263
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
264
264
|
_body_params: Optional[bytes] = None
|
265
265
|
|
266
266
|
# process the path parameters
|
@@ -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:
|
@@ -560,7 +561,7 @@ class GeospatialApi:
|
|
560
561
|
_query_params: List[Tuple[str, str]] = []
|
561
562
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
562
563
|
_form_params: List[Tuple[str, str]] = []
|
563
|
-
_files: Dict[str, str] = {}
|
564
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
564
565
|
_body_params: Optional[bytes] = None
|
565
566
|
|
566
567
|
# process the path parameters
|
@@ -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
|
|
@@ -17,7 +17,7 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
17
17
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
18
18
|
from typing_extensions import Annotated
|
19
19
|
|
20
|
-
from typing import Optional
|
20
|
+
from typing import List, Optional
|
21
21
|
from stadiamaps.models.isochrone_request import IsochroneRequest
|
22
22
|
from stadiamaps.models.isochrone_response import IsochroneResponse
|
23
23
|
from stadiamaps.models.locate_object import LocateObject
|
@@ -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
|
@@ -268,7 +268,7 @@ class RoutingApi:
|
|
268
268
|
_query_params: List[Tuple[str, str]] = []
|
269
269
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
270
270
|
_form_params: List[Tuple[str, str]] = []
|
271
|
-
_files: Dict[str, str] = {}
|
271
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
272
272
|
_body_params: Optional[bytes] = None
|
273
273
|
|
274
274
|
# process the path parameters
|
@@ -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:
|
@@ -545,7 +546,7 @@ class RoutingApi:
|
|
545
546
|
_query_params: List[Tuple[str, str]] = []
|
546
547
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
547
548
|
_form_params: List[Tuple[str, str]] = []
|
548
|
-
_files: Dict[str, str] = {}
|
549
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
549
550
|
_body_params: Optional[bytes] = None
|
550
551
|
|
551
552
|
# process the path parameters
|
@@ -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:
|
@@ -819,7 +821,7 @@ class RoutingApi:
|
|
819
821
|
_query_params: List[Tuple[str, str]] = []
|
820
822
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
821
823
|
_form_params: List[Tuple[str, str]] = []
|
822
|
-
_files: Dict[str, str] = {}
|
824
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
823
825
|
_body_params: Optional[bytes] = None
|
824
826
|
|
825
827
|
# process the path parameters
|
@@ -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:
|
@@ -1096,7 +1099,7 @@ class RoutingApi:
|
|
1096
1099
|
_query_params: List[Tuple[str, str]] = []
|
1097
1100
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1098
1101
|
_form_params: List[Tuple[str, str]] = []
|
1099
|
-
_files: Dict[str, str] = {}
|
1102
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
1100
1103
|
_body_params: Optional[bytes] = None
|
1101
1104
|
|
1102
1105
|
# process the path parameters
|
@@ -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:
|
@@ -1373,7 +1377,7 @@ class RoutingApi:
|
|
1373
1377
|
_query_params: List[Tuple[str, str]] = []
|
1374
1378
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1375
1379
|
_form_params: List[Tuple[str, str]] = []
|
1376
|
-
_files: Dict[str, str] = {}
|
1380
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
1377
1381
|
_body_params: Optional[bytes] = None
|
1378
1382
|
|
1379
1383
|
# process the path parameters
|
@@ -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:
|
@@ -1448,7 +1453,7 @@ class RoutingApi:
|
|
1448
1453
|
) -> MatrixResponse:
|
1449
1454
|
"""Calculate a time distance matrix for use in an optimizer.
|
1450
1455
|
|
1451
|
-
The time distance matrix API lets you compare travel times between a set of possible start and end points.
|
1456
|
+
The time distance matrix API lets you compare travel times between a set of possible start and end points. See https://docs.stadiamaps.com/limits/ for documentation of our latest limits.
|
1452
1457
|
|
1453
1458
|
:param matrix_request:
|
1454
1459
|
:type matrix_request: MatrixRequest
|
@@ -1516,7 +1521,7 @@ class RoutingApi:
|
|
1516
1521
|
) -> ApiResponse[MatrixResponse]:
|
1517
1522
|
"""Calculate a time distance matrix for use in an optimizer.
|
1518
1523
|
|
1519
|
-
The time distance matrix API lets you compare travel times between a set of possible start and end points.
|
1524
|
+
The time distance matrix API lets you compare travel times between a set of possible start and end points. See https://docs.stadiamaps.com/limits/ for documentation of our latest limits.
|
1520
1525
|
|
1521
1526
|
:param matrix_request:
|
1522
1527
|
:type matrix_request: MatrixRequest
|
@@ -1584,7 +1589,7 @@ class RoutingApi:
|
|
1584
1589
|
) -> RESTResponseType:
|
1585
1590
|
"""Calculate a time distance matrix for use in an optimizer.
|
1586
1591
|
|
1587
|
-
The time distance matrix API lets you compare travel times between a set of possible start and end points.
|
1592
|
+
The time distance matrix API lets you compare travel times between a set of possible start and end points. See https://docs.stadiamaps.com/limits/ for documentation of our latest limits.
|
1588
1593
|
|
1589
1594
|
:param matrix_request:
|
1590
1595
|
:type matrix_request: MatrixRequest
|
@@ -1647,7 +1652,7 @@ class RoutingApi:
|
|
1647
1652
|
_query_params: List[Tuple[str, str]] = []
|
1648
1653
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1649
1654
|
_form_params: List[Tuple[str, str]] = []
|
1650
|
-
_files: Dict[str, str] = {}
|
1655
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
1651
1656
|
_body_params: Optional[bytes] = None
|
1652
1657
|
|
1653
1658
|
# process the path parameters
|
@@ -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:
|
@@ -1921,7 +1927,7 @@ class RoutingApi:
|
|
1921
1927
|
_query_params: List[Tuple[str, str]] = []
|
1922
1928
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1923
1929
|
_form_params: List[Tuple[str, str]] = []
|
1924
|
-
_files: Dict[str, str] = {}
|
1930
|
+
_files: Dict[str, Union[str, bytes]] = {}
|
1925
1931
|
_body_params: Optional[bytes] = None
|
1926
1932
|
|
1927
1933
|
# process the path parameters
|
@@ -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
|
|
@@ -23,7 +23,8 @@ import re
|
|
23
23
|
import tempfile
|
24
24
|
|
25
25
|
from urllib.parse import quote
|
26
|
-
from typing import Tuple, Optional, List, Dict
|
26
|
+
from typing import Tuple, Optional, List, Dict, Union
|
27
|
+
from pydantic import SecretStr
|
27
28
|
|
28
29
|
from stadiamaps.configuration import Configuration
|
29
30
|
from stadiamaps.api_response import ApiResponse, T as ApiResponseT
|
@@ -88,7 +89,7 @@ class ApiClient:
|
|
88
89
|
self.default_headers[header_name] = header_value
|
89
90
|
self.cookie = cookie
|
90
91
|
# Set default User-Agent.
|
91
|
-
self.user_agent = 'OpenAPI-Generator/3.
|
92
|
+
self.user_agent = 'OpenAPI-Generator/3.2.0/python'
|
92
93
|
self.client_side_validation = configuration.client_side_validation
|
93
94
|
|
94
95
|
def __enter__(self):
|
@@ -208,7 +209,8 @@ class ApiClient:
|
|
208
209
|
post_params,
|
209
210
|
collection_formats
|
210
211
|
)
|
211
|
-
|
212
|
+
if files:
|
213
|
+
post_params.extend(self.files_parameters(files))
|
212
214
|
|
213
215
|
# auth setting
|
214
216
|
self.update_params_for_auth(
|
@@ -226,7 +228,7 @@ class ApiClient:
|
|
226
228
|
body = self.sanitize_for_serialization(body)
|
227
229
|
|
228
230
|
# request url
|
229
|
-
if _host is None:
|
231
|
+
if _host is None or self.configuration.ignore_operation_servers:
|
230
232
|
url = self.configuration.host + resource_path
|
231
233
|
else:
|
232
234
|
# use server/host defined in path or operation instead
|
@@ -313,7 +315,7 @@ class ApiClient:
|
|
313
315
|
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
314
316
|
encoding = match.group(1) if match else "utf-8"
|
315
317
|
response_text = response_data.data.decode(encoding)
|
316
|
-
return_data = self.deserialize(response_text, response_type)
|
318
|
+
return_data = self.deserialize(response_text, response_type, content_type)
|
317
319
|
finally:
|
318
320
|
if not 200 <= response_data.status <= 299:
|
319
321
|
raise ApiException.from_response(
|
@@ -333,6 +335,7 @@ class ApiClient:
|
|
333
335
|
"""Builds a JSON POST object.
|
334
336
|
|
335
337
|
If obj is None, return None.
|
338
|
+
If obj is SecretStr, return obj.get_secret_value()
|
336
339
|
If obj is str, int, long, float, bool, return directly.
|
337
340
|
If obj is datetime.datetime, datetime.date
|
338
341
|
convert to string in iso8601 format.
|
@@ -345,6 +348,10 @@ class ApiClient:
|
|
345
348
|
"""
|
346
349
|
if obj is None:
|
347
350
|
return None
|
351
|
+
elif isinstance(obj, Enum):
|
352
|
+
return obj.value
|
353
|
+
elif isinstance(obj, SecretStr):
|
354
|
+
return obj.get_secret_value()
|
348
355
|
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
349
356
|
return obj
|
350
357
|
elif isinstance(obj, list):
|
@@ -366,28 +373,45 @@ class ApiClient:
|
|
366
373
|
# and attributes which value is not None.
|
367
374
|
# Convert attribute name to json key in
|
368
375
|
# model definition for request.
|
369
|
-
|
376
|
+
if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
|
377
|
+
obj_dict = obj.to_dict()
|
378
|
+
else:
|
379
|
+
obj_dict = obj.__dict__
|
370
380
|
|
371
381
|
return {
|
372
382
|
key: self.sanitize_for_serialization(val)
|
373
383
|
for key, val in obj_dict.items()
|
374
384
|
}
|
375
385
|
|
376
|
-
def deserialize(self, response_text, response_type):
|
386
|
+
def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
|
377
387
|
"""Deserializes response into an object.
|
378
388
|
|
379
389
|
:param response: RESTResponse object to be deserialized.
|
380
390
|
:param response_type: class literal for
|
381
391
|
deserialized object, or string of class name.
|
392
|
+
:param content_type: content type of response.
|
382
393
|
|
383
394
|
:return: deserialized object.
|
384
395
|
"""
|
385
396
|
|
386
397
|
# fetch data from response object
|
387
|
-
|
388
|
-
|
389
|
-
|
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"):
|
390
409
|
data = response_text
|
410
|
+
else:
|
411
|
+
raise ApiException(
|
412
|
+
status=0,
|
413
|
+
reason="Unsupported content type: {0}".format(content_type)
|
414
|
+
)
|
391
415
|
|
392
416
|
return self.__deserialize(data, response_type)
|
393
417
|
|
@@ -481,8 +505,6 @@ class ApiClient:
|
|
481
505
|
v = str(v).lower()
|
482
506
|
if isinstance(v, (int, float)):
|
483
507
|
v = str(v)
|
484
|
-
if isinstance(v, Enum):
|
485
|
-
v = str(v.value)
|
486
508
|
if isinstance(v, dict):
|
487
509
|
v = json.dumps(v)
|
488
510
|
|
@@ -500,38 +522,37 @@ class ApiClient:
|
|
500
522
|
else: # csv is the default
|
501
523
|
delimiter = ','
|
502
524
|
new_params.append(
|
503
|
-
(k, delimiter.join(quote(str(value
|
525
|
+
(k, delimiter.join(quote(str(value)) for value in v))
|
504
526
|
)
|
505
527
|
else:
|
506
528
|
new_params.append((k, quote(str(v))))
|
507
529
|
|
508
530
|
return "&".join(["=".join(map(str, item)) for item in new_params])
|
509
531
|
|
510
|
-
def files_parameters(self, files
|
532
|
+
def files_parameters(self, files: Dict[str, Union[str, bytes]]):
|
511
533
|
"""Builds form parameters.
|
512
534
|
|
513
535
|
:param files: File parameters.
|
514
536
|
:return: Form parameters with files.
|
515
537
|
"""
|
516
538
|
params = []
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
539
|
+
for k, v in files.items():
|
540
|
+
if isinstance(v, str):
|
541
|
+
with open(v, 'rb') as f:
|
542
|
+
filename = os.path.basename(f.name)
|
543
|
+
filedata = f.read()
|
544
|
+
elif isinstance(v, bytes):
|
545
|
+
filename = k
|
546
|
+
filedata = v
|
547
|
+
else:
|
548
|
+
raise ValueError("Unsupported file value")
|
549
|
+
mimetype = (
|
550
|
+
mimetypes.guess_type(filename)[0]
|
551
|
+
or 'application/octet-stream'
|
552
|
+
)
|
553
|
+
params.append(
|
554
|
+
tuple([k, tuple([filename, filedata, mimetype])])
|
555
|
+
)
|
535
556
|
return params
|
536
557
|
|
537
558
|
def select_header_accept(self, accepts: List[str]) -> Optional[str]:
|
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
|
|