stadiamaps 4.0.0__py3-none-any.whl → 6.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 +32 -14
- stadiamaps/api/geocoding_api.py +976 -153
- stadiamaps/api/geospatial_api.py +7 -3
- stadiamaps/api/routing_api.py +22 -8
- stadiamaps/api_client.py +15 -6
- stadiamaps/configuration.py +156 -40
- stadiamaps/exceptions.py +18 -1
- stadiamaps/models/__init__.py +31 -13
- stadiamaps/models/access.py +1 -1
- stadiamaps/models/addendum_v2.py +143 -0
- stadiamaps/models/address_components_v2.py +134 -0
- stadiamaps/models/admin_region.py +1 -1
- stadiamaps/models/administrative.py +1 -1
- stadiamaps/models/annotation_filters.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 +4 -4
- stadiamaps/models/bicycle_costing_options.py +1 -1
- stadiamaps/models/bike_network.py +1 -1
- stadiamaps/models/bulk_request.py +1 -1
- stadiamaps/models/bulk_request_query.py +1 -1
- stadiamaps/models/bulk_search_response.py +4 -4
- stadiamaps/models/context.py +119 -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 +4 -4
- 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/extended_directions_options.py +1 -1
- stadiamaps/models/feature_properties_v2.py +126 -0
- stadiamaps/models/feature_properties_v2_properties.py +184 -0
- stadiamaps/models/foursquare_addendum.py +113 -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/{pelias_response.py → geocode_response.py} +8 -8
- stadiamaps/models/geocode_response_envelope_properties_v2.py +125 -0
- stadiamaps/models/{pelias_geo_json_feature.py → geocoding_geo_json_feature.py} +8 -8
- stadiamaps/models/{pelias_geo_json_properties.py → geocoding_geo_json_properties.py} +43 -15
- stadiamaps/models/{pelias_geo_json_properties_addendum.py → geocoding_geo_json_properties_addendum.py} +7 -7
- stadiamaps/models/{pelias_geo_json_properties_addendum_osm.py → geocoding_geo_json_properties_addendum_osm.py} +5 -5
- stadiamaps/models/{pelias_layer.py → geocoding_layer.py} +3 -3
- stadiamaps/models/geocoding_meta.py +108 -0
- stadiamaps/models/geocoding_object.py +1 -1
- stadiamaps/models/{pelias_source.py → geocoding_source.py} +4 -3
- stadiamaps/models/geonames_addendum.py +101 -0
- 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 +1 -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/layer_id.py +57 -0
- 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 +1 -1
- stadiamaps/models/map_match_request.py +10 -8
- stadiamaps/models/map_match_route_response.py +1 -1
- stadiamaps/models/map_match_trace_options.py +1 -1
- stadiamaps/models/map_match_waypoint.py +3 -3
- stadiamaps/models/match_type.py +39 -0
- 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 +4 -4
- 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 +4 -4
- stadiamaps/models/node_id.py +1 -1
- stadiamaps/models/node_type.py +1 -1
- stadiamaps/models/open_street_map_addendum.py +162 -0
- stadiamaps/models/optimized_route_request.py +10 -8
- stadiamaps/models/osrm_admin.py +1 -1
- stadiamaps/models/osrm_annotation.py +1 -1
- stadiamaps/models/osrm_banner_component.py +1 -1
- stadiamaps/models/osrm_banner_content.py +1 -1
- stadiamaps/models/osrm_banner_instruction.py +1 -1
- stadiamaps/models/osrm_base_api_response.py +1 -1
- stadiamaps/models/osrm_guidance_modifier.py +1 -1
- stadiamaps/models/osrm_intersection.py +1 -1
- stadiamaps/models/osrm_lane.py +1 -1
- stadiamaps/models/osrm_route.py +1 -1
- stadiamaps/models/osrm_route_leg.py +1 -1
- stadiamaps/models/osrm_route_response.py +1 -1
- stadiamaps/models/osrm_route_step.py +1 -1
- stadiamaps/models/osrm_speed_limit.py +1 -1
- stadiamaps/models/osrm_step_maneuver.py +1 -1
- stadiamaps/models/osrm_via_waypoint.py +1 -1
- stadiamaps/models/osrm_voice_instruction.py +1 -1
- stadiamaps/models/osrm_waypoint.py +1 -1
- stadiamaps/models/pedestrian_costing_options.py +8 -5
- stadiamaps/models/pedestrian_type.py +39 -0
- stadiamaps/models/point.py +104 -0
- stadiamaps/models/precision.py +38 -0
- stadiamaps/models/properties_v2.py +184 -0
- stadiamaps/models/restrictions.py +11 -11
- stadiamaps/models/road_class.py +1 -1
- stadiamaps/models/route200_response.py +1 -1
- stadiamaps/models/route_leg.py +1 -1
- 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 +7 -7
- stadiamaps/models/{valhalla_languages.py → routing_languages.py} +4 -4
- stadiamaps/models/{valhalla_long_units.py → routing_long_units.py} +4 -4
- stadiamaps/models/routing_response_waypoint.py +3 -3
- stadiamaps/models/routing_waypoint.py +3 -3
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +1 -1
- stadiamaps/models/search_query.py +7 -7
- stadiamaps/models/search_structured_query.py +8 -8
- stadiamaps/models/simple_routing_waypoint.py +3 -3
- stadiamaps/models/source_attribution.py +110 -0
- stadiamaps/models/source_id.py +41 -0
- 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 +10 -8
- stadiamaps/models/trace_attributes_response.py +4 -9
- stadiamaps/models/trace_edge.py +2 -7
- 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/warning.py +1 -1
- stadiamaps/models/whos_on_first_concordances.py +246 -0
- stadiamaps/models/wof_context.py +210 -0
- stadiamaps/models/wof_context_component.py +110 -0
- stadiamaps/rest.py +2 -2
- stadiamaps-6.0.0.dist-info/METADATA +117 -0
- stadiamaps-6.0.0.dist-info/RECORD +183 -0
- {stadiamaps-4.0.0.dist-info → stadiamaps-6.0.0.dist-info}/WHEEL +1 -1
- {stadiamaps-4.0.0.dist-info → stadiamaps-6.0.0.dist-info}/top_level.txt +1 -0
- test/integration/__init__.py +0 -0
- test/integration/test_eu_endpoint.py +21 -0
- test/integration/test_gecoding.py +112 -0
- test/integration/test_geospatial.py +43 -0
- test/integration/test_routing.py +282 -0
- stadiamaps/models/pelias_response_geocoding.py +0 -89
- stadiamaps/models/route_response_trip.py +0 -117
- stadiamaps/models/trace_attributes_response_all_of.py +0 -96
- stadiamaps-4.0.0.dist-info/METADATA +0 -79
- stadiamaps-4.0.0.dist-info/RECORD +0 -160
- {stadiamaps-4.0.0.dist-info → stadiamaps-6.0.0.dist-info/licenses}/LICENSE.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:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -260,7 +260,9 @@ 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[
|
263
|
+
_files: Dict[
|
264
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
265
|
+
] = {}
|
264
266
|
_body_params: Optional[bytes] = None
|
265
267
|
|
266
268
|
# process the path parameters
|
@@ -561,7 +563,9 @@ class GeospatialApi:
|
|
561
563
|
_query_params: List[Tuple[str, str]] = []
|
562
564
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
563
565
|
_form_params: List[Tuple[str, str]] = []
|
564
|
-
_files: Dict[
|
566
|
+
_files: Dict[
|
567
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
568
|
+
] = {}
|
565
569
|
_body_params: Optional[bytes] = None
|
566
570
|
|
567
571
|
# process the path parameters
|
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:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -268,7 +268,9 @@ 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[
|
271
|
+
_files: Dict[
|
272
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
273
|
+
] = {}
|
272
274
|
_body_params: Optional[bytes] = None
|
273
275
|
|
274
276
|
# process the path parameters
|
@@ -546,7 +548,9 @@ class RoutingApi:
|
|
546
548
|
_query_params: List[Tuple[str, str]] = []
|
547
549
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
548
550
|
_form_params: List[Tuple[str, str]] = []
|
549
|
-
_files: Dict[
|
551
|
+
_files: Dict[
|
552
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
553
|
+
] = {}
|
550
554
|
_body_params: Optional[bytes] = None
|
551
555
|
|
552
556
|
# process the path parameters
|
@@ -821,7 +825,9 @@ class RoutingApi:
|
|
821
825
|
_query_params: List[Tuple[str, str]] = []
|
822
826
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
823
827
|
_form_params: List[Tuple[str, str]] = []
|
824
|
-
_files: Dict[
|
828
|
+
_files: Dict[
|
829
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
830
|
+
] = {}
|
825
831
|
_body_params: Optional[bytes] = None
|
826
832
|
|
827
833
|
# process the path parameters
|
@@ -1099,7 +1105,9 @@ class RoutingApi:
|
|
1099
1105
|
_query_params: List[Tuple[str, str]] = []
|
1100
1106
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1101
1107
|
_form_params: List[Tuple[str, str]] = []
|
1102
|
-
_files: Dict[
|
1108
|
+
_files: Dict[
|
1109
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1110
|
+
] = {}
|
1103
1111
|
_body_params: Optional[bytes] = None
|
1104
1112
|
|
1105
1113
|
# process the path parameters
|
@@ -1377,7 +1385,9 @@ class RoutingApi:
|
|
1377
1385
|
_query_params: List[Tuple[str, str]] = []
|
1378
1386
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1379
1387
|
_form_params: List[Tuple[str, str]] = []
|
1380
|
-
_files: Dict[
|
1388
|
+
_files: Dict[
|
1389
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1390
|
+
] = {}
|
1381
1391
|
_body_params: Optional[bytes] = None
|
1382
1392
|
|
1383
1393
|
# process the path parameters
|
@@ -1652,7 +1662,9 @@ class RoutingApi:
|
|
1652
1662
|
_query_params: List[Tuple[str, str]] = []
|
1653
1663
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1654
1664
|
_form_params: List[Tuple[str, str]] = []
|
1655
|
-
_files: Dict[
|
1665
|
+
_files: Dict[
|
1666
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1667
|
+
] = {}
|
1656
1668
|
_body_params: Optional[bytes] = None
|
1657
1669
|
|
1658
1670
|
# process the path parameters
|
@@ -1927,7 +1939,9 @@ class RoutingApi:
|
|
1927
1939
|
_query_params: List[Tuple[str, str]] = []
|
1928
1940
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1929
1941
|
_form_params: List[Tuple[str, str]] = []
|
1930
|
-
_files: Dict[
|
1942
|
+
_files: Dict[
|
1943
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1944
|
+
] = {}
|
1931
1945
|
_body_params: Optional[bytes] = None
|
1932
1946
|
|
1933
1947
|
# process the path parameters
|
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:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -91,7 +91,7 @@ class ApiClient:
|
|
91
91
|
self.default_headers[header_name] = header_value
|
92
92
|
self.cookie = cookie
|
93
93
|
# Set default User-Agent.
|
94
|
-
self.user_agent = 'OpenAPI-Generator/
|
94
|
+
self.user_agent = 'OpenAPI-Generator/6.0.0/python'
|
95
95
|
self.client_side_validation = configuration.client_side_validation
|
96
96
|
|
97
97
|
def __enter__(self):
|
@@ -405,12 +405,12 @@ class ApiClient:
|
|
405
405
|
data = json.loads(response_text)
|
406
406
|
except ValueError:
|
407
407
|
data = response_text
|
408
|
-
elif
|
408
|
+
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
409
409
|
if response_text == "":
|
410
410
|
data = ""
|
411
411
|
else:
|
412
412
|
data = json.loads(response_text)
|
413
|
-
elif
|
413
|
+
elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
|
414
414
|
data = response_text
|
415
415
|
else:
|
416
416
|
raise ApiException(
|
@@ -518,7 +518,7 @@ class ApiClient:
|
|
518
518
|
if k in collection_formats:
|
519
519
|
collection_format = collection_formats[k]
|
520
520
|
if collection_format == 'multi':
|
521
|
-
new_params.extend((k, str(value)) for value in v)
|
521
|
+
new_params.extend((k, quote(str(value))) for value in v)
|
522
522
|
else:
|
523
523
|
if collection_format == 'ssv':
|
524
524
|
delimiter = ' '
|
@@ -536,7 +536,10 @@ class ApiClient:
|
|
536
536
|
|
537
537
|
return "&".join(["=".join(map(str, item)) for item in new_params])
|
538
538
|
|
539
|
-
def files_parameters(
|
539
|
+
def files_parameters(
|
540
|
+
self,
|
541
|
+
files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
|
542
|
+
):
|
540
543
|
"""Builds form parameters.
|
541
544
|
|
542
545
|
:param files: File parameters.
|
@@ -551,6 +554,12 @@ class ApiClient:
|
|
551
554
|
elif isinstance(v, bytes):
|
552
555
|
filename = k
|
553
556
|
filedata = v
|
557
|
+
elif isinstance(v, tuple):
|
558
|
+
filename, filedata = v
|
559
|
+
elif isinstance(v, list):
|
560
|
+
for file_param in v:
|
561
|
+
params.extend(self.files_parameters({k: file_param}))
|
562
|
+
continue
|
554
563
|
else:
|
555
564
|
raise ValueError("Unsupported file value")
|
556
565
|
mimetype = (
|
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:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -14,14 +14,16 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
import copy
|
17
|
+
import http.client as httplib
|
17
18
|
import logging
|
18
19
|
from logging import FileHandler
|
19
20
|
import multiprocessing
|
20
21
|
import sys
|
21
|
-
from typing import Optional
|
22
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
|
23
|
+
from typing_extensions import NotRequired, Self
|
24
|
+
|
22
25
|
import urllib3
|
23
26
|
|
24
|
-
import http.client as httplib
|
25
27
|
|
26
28
|
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
27
29
|
'multipleOf', 'maximum', 'exclusiveMaximum',
|
@@ -29,6 +31,107 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
29
31
|
'minLength', 'pattern', 'maxItems', 'minItems'
|
30
32
|
}
|
31
33
|
|
34
|
+
ServerVariablesT = Dict[str, str]
|
35
|
+
|
36
|
+
GenericAuthSetting = TypedDict(
|
37
|
+
"GenericAuthSetting",
|
38
|
+
{
|
39
|
+
"type": str,
|
40
|
+
"in": str,
|
41
|
+
"key": str,
|
42
|
+
"value": str,
|
43
|
+
},
|
44
|
+
)
|
45
|
+
|
46
|
+
|
47
|
+
OAuth2AuthSetting = TypedDict(
|
48
|
+
"OAuth2AuthSetting",
|
49
|
+
{
|
50
|
+
"type": Literal["oauth2"],
|
51
|
+
"in": Literal["header"],
|
52
|
+
"key": Literal["Authorization"],
|
53
|
+
"value": str,
|
54
|
+
},
|
55
|
+
)
|
56
|
+
|
57
|
+
|
58
|
+
APIKeyAuthSetting = TypedDict(
|
59
|
+
"APIKeyAuthSetting",
|
60
|
+
{
|
61
|
+
"type": Literal["api_key"],
|
62
|
+
"in": str,
|
63
|
+
"key": str,
|
64
|
+
"value": Optional[str],
|
65
|
+
},
|
66
|
+
)
|
67
|
+
|
68
|
+
|
69
|
+
BasicAuthSetting = TypedDict(
|
70
|
+
"BasicAuthSetting",
|
71
|
+
{
|
72
|
+
"type": Literal["basic"],
|
73
|
+
"in": Literal["header"],
|
74
|
+
"key": Literal["Authorization"],
|
75
|
+
"value": Optional[str],
|
76
|
+
},
|
77
|
+
)
|
78
|
+
|
79
|
+
|
80
|
+
BearerFormatAuthSetting = TypedDict(
|
81
|
+
"BearerFormatAuthSetting",
|
82
|
+
{
|
83
|
+
"type": Literal["bearer"],
|
84
|
+
"in": Literal["header"],
|
85
|
+
"format": Literal["JWT"],
|
86
|
+
"key": Literal["Authorization"],
|
87
|
+
"value": str,
|
88
|
+
},
|
89
|
+
)
|
90
|
+
|
91
|
+
|
92
|
+
BearerAuthSetting = TypedDict(
|
93
|
+
"BearerAuthSetting",
|
94
|
+
{
|
95
|
+
"type": Literal["bearer"],
|
96
|
+
"in": Literal["header"],
|
97
|
+
"key": Literal["Authorization"],
|
98
|
+
"value": str,
|
99
|
+
},
|
100
|
+
)
|
101
|
+
|
102
|
+
|
103
|
+
HTTPSignatureAuthSetting = TypedDict(
|
104
|
+
"HTTPSignatureAuthSetting",
|
105
|
+
{
|
106
|
+
"type": Literal["http-signature"],
|
107
|
+
"in": Literal["header"],
|
108
|
+
"key": Literal["Authorization"],
|
109
|
+
"value": None,
|
110
|
+
},
|
111
|
+
)
|
112
|
+
|
113
|
+
|
114
|
+
AuthSettings = TypedDict(
|
115
|
+
"AuthSettings",
|
116
|
+
{
|
117
|
+
"ApiKeyAuth": APIKeyAuthSetting,
|
118
|
+
},
|
119
|
+
total=False,
|
120
|
+
)
|
121
|
+
|
122
|
+
|
123
|
+
class HostSettingVariable(TypedDict):
|
124
|
+
description: str
|
125
|
+
default_value: str
|
126
|
+
enum_values: List[str]
|
127
|
+
|
128
|
+
|
129
|
+
class HostSetting(TypedDict):
|
130
|
+
url: str
|
131
|
+
description: str
|
132
|
+
variables: NotRequired[Dict[str, HostSettingVariable]]
|
133
|
+
|
134
|
+
|
32
135
|
class Configuration:
|
33
136
|
"""This class contains various settings of the API client.
|
34
137
|
|
@@ -82,20 +185,26 @@ conf = stadiamaps.Configuration(
|
|
82
185
|
Cookie: JSESSIONID abc123
|
83
186
|
"""
|
84
187
|
|
85
|
-
_default = None
|
86
|
-
|
87
|
-
def __init__(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
188
|
+
_default: ClassVar[Optional[Self]] = None
|
189
|
+
|
190
|
+
def __init__(
|
191
|
+
self,
|
192
|
+
host: Optional[str]=None,
|
193
|
+
api_key: Optional[Dict[str, str]]=None,
|
194
|
+
api_key_prefix: Optional[Dict[str, str]]=None,
|
195
|
+
username: Optional[str]=None,
|
196
|
+
password: Optional[str]=None,
|
197
|
+
access_token: Optional[str]=None,
|
198
|
+
server_index: Optional[int]=None,
|
199
|
+
server_variables: Optional[ServerVariablesT]=None,
|
200
|
+
server_operation_index: Optional[Dict[int, int]]=None,
|
201
|
+
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
|
202
|
+
ignore_operation_servers: bool=False,
|
203
|
+
ssl_ca_cert: Optional[str]=None,
|
204
|
+
retries: Optional[int] = None,
|
205
|
+
*,
|
206
|
+
debug: Optional[bool] = None,
|
207
|
+
) -> None:
|
99
208
|
"""Constructor
|
100
209
|
"""
|
101
210
|
self._base_path = "https://api.stadiamaps.com" if host is None else host
|
@@ -219,7 +328,7 @@ conf = stadiamaps.Configuration(
|
|
219
328
|
"""date format
|
220
329
|
"""
|
221
330
|
|
222
|
-
def __deepcopy__(self, memo):
|
331
|
+
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
223
332
|
cls = self.__class__
|
224
333
|
result = cls.__new__(cls)
|
225
334
|
memo[id(self)] = result
|
@@ -233,11 +342,11 @@ conf = stadiamaps.Configuration(
|
|
233
342
|
result.debug = self.debug
|
234
343
|
return result
|
235
344
|
|
236
|
-
def __setattr__(self, name, value):
|
345
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
237
346
|
object.__setattr__(self, name, value)
|
238
347
|
|
239
348
|
@classmethod
|
240
|
-
def set_default(cls, default):
|
349
|
+
def set_default(cls, default: Optional[Self]) -> None:
|
241
350
|
"""Set default instance of configuration.
|
242
351
|
|
243
352
|
It stores default configuration, which can be
|
@@ -248,7 +357,7 @@ conf = stadiamaps.Configuration(
|
|
248
357
|
cls._default = default
|
249
358
|
|
250
359
|
@classmethod
|
251
|
-
def get_default_copy(cls):
|
360
|
+
def get_default_copy(cls) -> Self:
|
252
361
|
"""Deprecated. Please use `get_default` instead.
|
253
362
|
|
254
363
|
Deprecated. Please use `get_default` instead.
|
@@ -258,7 +367,7 @@ conf = stadiamaps.Configuration(
|
|
258
367
|
return cls.get_default()
|
259
368
|
|
260
369
|
@classmethod
|
261
|
-
def get_default(cls):
|
370
|
+
def get_default(cls) -> Self:
|
262
371
|
"""Return the default configuration.
|
263
372
|
|
264
373
|
This method returns newly created, based on default constructor,
|
@@ -268,11 +377,11 @@ conf = stadiamaps.Configuration(
|
|
268
377
|
:return: The configuration object.
|
269
378
|
"""
|
270
379
|
if cls._default is None:
|
271
|
-
cls._default =
|
380
|
+
cls._default = cls()
|
272
381
|
return cls._default
|
273
382
|
|
274
383
|
@property
|
275
|
-
def logger_file(self):
|
384
|
+
def logger_file(self) -> Optional[str]:
|
276
385
|
"""The logger file.
|
277
386
|
|
278
387
|
If the logger_file is None, then add stream handler and remove file
|
@@ -284,7 +393,7 @@ conf = stadiamaps.Configuration(
|
|
284
393
|
return self.__logger_file
|
285
394
|
|
286
395
|
@logger_file.setter
|
287
|
-
def logger_file(self, value):
|
396
|
+
def logger_file(self, value: Optional[str]) -> None:
|
288
397
|
"""The logger file.
|
289
398
|
|
290
399
|
If the logger_file is None, then add stream handler and remove file
|
@@ -303,7 +412,7 @@ conf = stadiamaps.Configuration(
|
|
303
412
|
logger.addHandler(self.logger_file_handler)
|
304
413
|
|
305
414
|
@property
|
306
|
-
def debug(self):
|
415
|
+
def debug(self) -> bool:
|
307
416
|
"""Debug status
|
308
417
|
|
309
418
|
:param value: The debug status, True or False.
|
@@ -312,7 +421,7 @@ conf = stadiamaps.Configuration(
|
|
312
421
|
return self.__debug
|
313
422
|
|
314
423
|
@debug.setter
|
315
|
-
def debug(self, value):
|
424
|
+
def debug(self, value: bool) -> None:
|
316
425
|
"""Debug status
|
317
426
|
|
318
427
|
:param value: The debug status, True or False.
|
@@ -334,7 +443,7 @@ conf = stadiamaps.Configuration(
|
|
334
443
|
httplib.HTTPConnection.debuglevel = 0
|
335
444
|
|
336
445
|
@property
|
337
|
-
def logger_format(self):
|
446
|
+
def logger_format(self) -> str:
|
338
447
|
"""The logger format.
|
339
448
|
|
340
449
|
The logger_formatter will be updated when sets logger_format.
|
@@ -345,7 +454,7 @@ conf = stadiamaps.Configuration(
|
|
345
454
|
return self.__logger_format
|
346
455
|
|
347
456
|
@logger_format.setter
|
348
|
-
def logger_format(self, value):
|
457
|
+
def logger_format(self, value: str) -> None:
|
349
458
|
"""The logger format.
|
350
459
|
|
351
460
|
The logger_formatter will be updated when sets logger_format.
|
@@ -356,7 +465,7 @@ conf = stadiamaps.Configuration(
|
|
356
465
|
self.__logger_format = value
|
357
466
|
self.logger_formatter = logging.Formatter(self.__logger_format)
|
358
467
|
|
359
|
-
def get_api_key_with_prefix(self, identifier, alias=None):
|
468
|
+
def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
|
360
469
|
"""Gets API key (with prefix if set).
|
361
470
|
|
362
471
|
:param identifier: The identifier of apiKey.
|
@@ -373,7 +482,9 @@ conf = stadiamaps.Configuration(
|
|
373
482
|
else:
|
374
483
|
return key
|
375
484
|
|
376
|
-
|
485
|
+
return None
|
486
|
+
|
487
|
+
def get_basic_auth_token(self) -> Optional[str]:
|
377
488
|
"""Gets HTTP basic authentication header (string).
|
378
489
|
|
379
490
|
:return: The token for basic HTTP authentication.
|
@@ -388,12 +499,12 @@ conf = stadiamaps.Configuration(
|
|
388
499
|
basic_auth=username + ':' + password
|
389
500
|
).get('authorization')
|
390
501
|
|
391
|
-
def auth_settings(self):
|
502
|
+
def auth_settings(self)-> AuthSettings:
|
392
503
|
"""Gets Auth Settings dict for api client.
|
393
504
|
|
394
505
|
:return: The Auth Settings information dict.
|
395
506
|
"""
|
396
|
-
auth = {}
|
507
|
+
auth: AuthSettings = {}
|
397
508
|
if 'ApiKeyAuth' in self.api_key:
|
398
509
|
auth['ApiKeyAuth'] = {
|
399
510
|
'type': 'api_key',
|
@@ -405,7 +516,7 @@ conf = stadiamaps.Configuration(
|
|
405
516
|
}
|
406
517
|
return auth
|
407
518
|
|
408
|
-
def to_debug_report(self):
|
519
|
+
def to_debug_report(self) -> str:
|
409
520
|
"""Gets the essential information for debugging.
|
410
521
|
|
411
522
|
:return: The report for debugging.
|
@@ -413,11 +524,11 @@ conf = stadiamaps.Configuration(
|
|
413
524
|
return "Python SDK Debug Report:\n"\
|
414
525
|
"OS: {env}\n"\
|
415
526
|
"Python Version: {pyversion}\n"\
|
416
|
-
"Version of the API:
|
417
|
-
"SDK Package Version:
|
527
|
+
"Version of the API: 9.0.0\n"\
|
528
|
+
"SDK Package Version: 6.0.0".\
|
418
529
|
format(env=sys.platform, pyversion=sys.version)
|
419
530
|
|
420
|
-
def get_host_settings(self):
|
531
|
+
def get_host_settings(self) -> List[HostSetting]:
|
421
532
|
"""Gets an array of host settings
|
422
533
|
|
423
534
|
:return: An array of host settings
|
@@ -433,7 +544,12 @@ conf = stadiamaps.Configuration(
|
|
433
544
|
}
|
434
545
|
]
|
435
546
|
|
436
|
-
def get_host_from_settings(
|
547
|
+
def get_host_from_settings(
|
548
|
+
self,
|
549
|
+
index: Optional[int],
|
550
|
+
variables: Optional[ServerVariablesT]=None,
|
551
|
+
servers: Optional[List[HostSetting]]=None,
|
552
|
+
) -> str:
|
437
553
|
"""Gets host URL based on the index and variables
|
438
554
|
:param index: array index of the host settings
|
439
555
|
:param variables: hash of variable and the corresponding value
|
@@ -473,12 +589,12 @@ conf = stadiamaps.Configuration(
|
|
473
589
|
return url
|
474
590
|
|
475
591
|
@property
|
476
|
-
def host(self):
|
592
|
+
def host(self) -> str:
|
477
593
|
"""Return generated host."""
|
478
594
|
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
479
595
|
|
480
596
|
@host.setter
|
481
|
-
def host(self, value):
|
597
|
+
def host(self, value: str) -> None:
|
482
598
|
"""Fix base path."""
|
483
599
|
self._base_path = value
|
484
600
|
self.server_index = None
|
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:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -151,6 +151,13 @@ class ApiException(OpenApiException):
|
|
151
151
|
if http_resp.status == 404:
|
152
152
|
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
153
153
|
|
154
|
+
# Added new conditions for 409 and 422
|
155
|
+
if http_resp.status == 409:
|
156
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
157
|
+
|
158
|
+
if http_resp.status == 422:
|
159
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
160
|
+
|
154
161
|
if 500 <= http_resp.status <= 599:
|
155
162
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
156
163
|
raise ApiException(http_resp=http_resp, body=body, data=data)
|
@@ -189,6 +196,16 @@ class ServiceException(ApiException):
|
|
189
196
|
pass
|
190
197
|
|
191
198
|
|
199
|
+
class ConflictException(ApiException):
|
200
|
+
"""Exception for HTTP 409 Conflict."""
|
201
|
+
pass
|
202
|
+
|
203
|
+
|
204
|
+
class UnprocessableEntityException(ApiException):
|
205
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
206
|
+
pass
|
207
|
+
|
208
|
+
|
192
209
|
def render_path(path_to_item):
|
193
210
|
"""Returns a string representation of a path"""
|
194
211
|
result = ""
|