stadiamaps 1.0.6__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stadiamaps/__init__.py +6 -24
- stadiamaps/api/geocoding_api.py +1917 -760
- stadiamaps/api/geospatial_api.py +483 -221
- stadiamaps/api/routing_api.py +1615 -723
- stadiamaps/api_client.py +275 -272
- stadiamaps/api_response.py +12 -16
- stadiamaps/configuration.py +13 -11
- stadiamaps/exceptions.py +67 -30
- stadiamaps/models/__init__.py +5 -23
- stadiamaps/models/access.py +44 -26
- stadiamaps/models/admin_region.py +46 -28
- stadiamaps/models/administrative.py +48 -30
- stadiamaps/models/auto_costing_options.py +69 -48
- stadiamaps/models/auto_costing_options_all_of.py +1 -1
- stadiamaps/models/base_costing_options.py +52 -33
- stadiamaps/models/base_trace_request.py +70 -40
- stadiamaps/models/bicycle_costing_options.py +61 -42
- stadiamaps/models/bicycle_costing_options_all_of.py +1 -1
- stadiamaps/models/bike_network.py +42 -24
- stadiamaps/models/contour.py +45 -27
- stadiamaps/models/coordinate.py +45 -26
- stadiamaps/models/costing_model.py +10 -12
- stadiamaps/models/costing_options.py +51 -33
- stadiamaps/models/directions_options.py +45 -27
- stadiamaps/models/distance_unit.py +8 -11
- stadiamaps/models/edge_sign.py +46 -28
- stadiamaps/models/edge_use.py +8 -11
- stadiamaps/models/end_node.py +48 -30
- stadiamaps/models/geo_attributes.py +47 -29
- stadiamaps/models/geo_json_geometry.py +25 -25
- stadiamaps/models/geo_json_geometry_base.py +45 -27
- stadiamaps/models/geo_json_line_string.py +47 -28
- stadiamaps/models/geo_json_line_string_all_of.py +2 -2
- stadiamaps/models/geo_json_point.py +47 -28
- stadiamaps/models/geo_json_point_all_of.py +2 -2
- stadiamaps/models/geo_json_polygon.py +47 -28
- stadiamaps/models/geo_json_polygon_all_of.py +2 -2
- stadiamaps/models/geocoding_object.py +46 -28
- stadiamaps/models/height_request.py +55 -34
- stadiamaps/models/height_response.py +49 -30
- stadiamaps/models/highway_classification.py +52 -34
- stadiamaps/models/intersecting_edge.py +45 -27
- stadiamaps/models/isochrone_costing_model.py +8 -11
- stadiamaps/models/isochrone_feature.py +45 -27
- stadiamaps/models/isochrone_properties.py +48 -30
- stadiamaps/models/isochrone_request.py +54 -35
- stadiamaps/models/isochrone_response.py +47 -29
- stadiamaps/models/locate_detailed_edge.py +73 -55
- stadiamaps/models/locate_edge.py +56 -39
- stadiamaps/models/locate_edge_info.py +47 -29
- stadiamaps/models/locate_node.py +50 -31
- stadiamaps/models/locate_node_all_of.py +1 -1
- stadiamaps/models/locate_object.py +49 -31
- stadiamaps/models/maneuver_sign.py +50 -32
- stadiamaps/models/maneuver_sign_element.py +45 -27
- stadiamaps/models/map_match_costing_model.py +8 -11
- stadiamaps/models/map_match_request.py +74 -44
- stadiamaps/models/map_match_request_all_of.py +1 -1
- stadiamaps/models/map_match_route_response.py +57 -29
- stadiamaps/models/map_match_route_response_all_of.py +1 -1
- stadiamaps/models/map_match_trace_options.py +47 -29
- stadiamaps/models/map_match_waypoint.py +49 -30
- stadiamaps/models/map_match_waypoint_all_of.py +1 -1
- stadiamaps/models/matched_point.py +52 -34
- stadiamaps/models/matrix_costing_model.py +9 -12
- stadiamaps/models/matrix_distance.py +46 -28
- stadiamaps/models/matrix_request.py +70 -39
- stadiamaps/models/matrix_response.py +60 -36
- stadiamaps/models/motor_scooter_costing_options.py +70 -49
- stadiamaps/models/motor_scooter_costing_options_all_of.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +69 -48
- stadiamaps/models/motorcycle_costing_options_all_of.py +1 -1
- stadiamaps/models/nearest_roads_request.py +65 -34
- stadiamaps/models/node_id.py +42 -24
- stadiamaps/models/node_type.py +8 -11
- stadiamaps/models/optimized_route_request.py +66 -35
- stadiamaps/models/pedestrian_costing_options.py +59 -40
- stadiamaps/models/pelias_geo_json_feature.py +50 -31
- stadiamaps/models/pelias_geo_json_properties.py +54 -36
- stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
- stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
- stadiamaps/models/pelias_layer.py +8 -11
- stadiamaps/models/pelias_response.py +49 -30
- stadiamaps/models/pelias_response_geocoding.py +1 -1
- stadiamaps/models/pelias_source.py +8 -11
- stadiamaps/models/restrictions.py +44 -26
- stadiamaps/models/road_class.py +8 -11
- stadiamaps/models/route_leg.py +48 -29
- stadiamaps/models/route_maneuver.py +73 -55
- stadiamaps/models/route_request.py +76 -43
- stadiamaps/models/route_response.py +56 -28
- stadiamaps/models/route_response_alternates_inner.py +105 -0
- stadiamaps/models/route_response_trip.py +1 -1
- stadiamaps/models/route_summary.py +48 -30
- stadiamaps/models/route_trip.py +135 -0
- stadiamaps/models/routing_response_waypoint.py +49 -30
- stadiamaps/models/routing_response_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint.py +60 -41
- stadiamaps/models/routing_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
- stadiamaps/models/simple_routing_waypoint.py +48 -29
- stadiamaps/models/simple_routing_waypoint_all_of.py +1 -1
- stadiamaps/models/speeds.py +49 -31
- stadiamaps/models/trace_attribute_filter_options.py +47 -28
- stadiamaps/models/trace_attribute_key.py +8 -11
- stadiamaps/models/trace_attributes_base_response.py +51 -32
- stadiamaps/models/trace_attributes_request.py +72 -42
- stadiamaps/models/trace_attributes_request_all_of.py +1 -1
- stadiamaps/models/trace_attributes_request_all_of_filters.py +2 -2
- stadiamaps/models/trace_attributes_response.py +54 -35
- stadiamaps/models/trace_attributes_response_all_of.py +1 -1
- stadiamaps/models/trace_edge.py +88 -70
- stadiamaps/models/travel_mode.py +8 -11
- stadiamaps/models/traversability.py +8 -11
- stadiamaps/models/truck_costing_options.py +72 -51
- stadiamaps/models/truck_costing_options_all_of.py +1 -1
- stadiamaps/models/tz_response.py +45 -27
- stadiamaps/models/valhalla_languages.py +8 -11
- stadiamaps/models/valhalla_long_units.py +8 -11
- stadiamaps/models/warning.py +42 -24
- stadiamaps/py.typed +0 -0
- stadiamaps/rest.py +127 -172
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/METADATA +4 -4
- stadiamaps-2.0.0.dist-info/RECORD +128 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/WHEEL +1 -1
- stadiamaps-1.0.6.dist-info/RECORD +0 -125
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/top_level.txt +0 -0
stadiamaps/api_response.py
CHANGED
@@ -1,25 +1,21 @@
|
|
1
1
|
"""API response object."""
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
|
-
from typing import
|
5
|
-
from pydantic import Field, StrictInt,
|
4
|
+
from typing import Optional, Generic, Mapping, TypeVar
|
5
|
+
from pydantic import Field, StrictInt, StrictBytes, BaseModel
|
6
6
|
|
7
|
-
|
7
|
+
T = TypeVar("T")
|
8
|
+
|
9
|
+
class ApiResponse(BaseModel, Generic[T]):
|
8
10
|
"""
|
9
11
|
API response object
|
10
12
|
"""
|
11
13
|
|
12
|
-
status_code:
|
13
|
-
headers: Optional[
|
14
|
-
data:
|
15
|
-
raw_data:
|
14
|
+
status_code: StrictInt = Field(description="HTTP status code")
|
15
|
+
headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
|
16
|
+
data: T = Field(description="Deserialized data given the data type")
|
17
|
+
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
data=None,
|
21
|
-
raw_data=None):
|
22
|
-
self.status_code = status_code
|
23
|
-
self.headers = headers
|
24
|
-
self.data = data
|
25
|
-
self.raw_data = raw_data
|
19
|
+
model_config = {
|
20
|
+
"arbitrary_types_allowed": True
|
21
|
+
}
|
stadiamaps/configuration.py
CHANGED
@@ -3,24 +3,25 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
import copy
|
17
17
|
import logging
|
18
|
+
from logging import FileHandler
|
18
19
|
import multiprocessing
|
19
20
|
import sys
|
21
|
+
from typing import Optional
|
20
22
|
import urllib3
|
21
23
|
|
22
24
|
import http.client as httplib
|
23
|
-
from stadiamaps.exceptions import ApiValueError
|
24
25
|
|
25
26
|
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
26
27
|
'multipleOf', 'maximum', 'exclusiveMaximum',
|
@@ -28,7 +29,7 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
28
29
|
'minLength', 'pattern', 'maxItems', 'minItems'
|
29
30
|
}
|
30
31
|
|
31
|
-
class Configuration
|
32
|
+
class Configuration:
|
32
33
|
"""This class contains various settings of the API client.
|
33
34
|
|
34
35
|
:param host: Base url.
|
@@ -50,7 +51,8 @@ class Configuration(object):
|
|
50
51
|
configuration.
|
51
52
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
52
53
|
string values to replace variables in templated server configuration.
|
53
|
-
The validation of enums is performed for variables with defined enum
|
54
|
+
The validation of enums is performed for variables with defined enum
|
55
|
+
values before.
|
54
56
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
55
57
|
in PEM format.
|
56
58
|
|
@@ -85,7 +87,7 @@ conf = stadiamaps.Configuration(
|
|
85
87
|
server_index=None, server_variables=None,
|
86
88
|
server_operation_index=None, server_operation_variables=None,
|
87
89
|
ssl_ca_cert=None,
|
88
|
-
):
|
90
|
+
) -> None:
|
89
91
|
"""Constructor
|
90
92
|
"""
|
91
93
|
self._base_path = "https://api.stadiamaps.com" if host is None else host
|
@@ -136,7 +138,7 @@ conf = stadiamaps.Configuration(
|
|
136
138
|
self.logger_stream_handler = None
|
137
139
|
"""Log stream handler
|
138
140
|
"""
|
139
|
-
self.logger_file_handler = None
|
141
|
+
self.logger_file_handler: Optional[FileHandler] = None
|
140
142
|
"""Log file handler
|
141
143
|
"""
|
142
144
|
self.logger_file = None
|
@@ -176,7 +178,7 @@ conf = stadiamaps.Configuration(
|
|
176
178
|
cpu_count * 5 is used as default value to increase performance.
|
177
179
|
"""
|
178
180
|
|
179
|
-
self.proxy = None
|
181
|
+
self.proxy: Optional[str] = None
|
180
182
|
"""Proxy URL
|
181
183
|
"""
|
182
184
|
self.proxy_headers = None
|
@@ -397,8 +399,8 @@ conf = stadiamaps.Configuration(
|
|
397
399
|
return "Python SDK Debug Report:\n"\
|
398
400
|
"OS: {env}\n"\
|
399
401
|
"Python Version: {pyversion}\n"\
|
400
|
-
"Version of the API:
|
401
|
-
"SDK Package Version:
|
402
|
+
"Version of the API: 6.0.0\n"\
|
403
|
+
"SDK Package Version: 2.0.0".\
|
402
404
|
format(env=sys.platform, pyversion=sys.version)
|
403
405
|
|
404
406
|
def get_host_settings(self):
|
stadiamaps/exceptions.py
CHANGED
@@ -3,15 +3,17 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
|
+
from typing import Any, Optional
|
16
|
+
from typing_extensions import Self
|
15
17
|
|
16
18
|
class OpenApiException(Exception):
|
17
19
|
"""The base exception class for all OpenAPIExceptions"""
|
@@ -19,7 +21,7 @@ class OpenApiException(Exception):
|
|
19
21
|
|
20
22
|
class ApiTypeError(OpenApiException, TypeError):
|
21
23
|
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
22
|
-
key_type=None):
|
24
|
+
key_type=None) -> None:
|
23
25
|
""" Raises an exception for TypeErrors
|
24
26
|
|
25
27
|
Args:
|
@@ -47,7 +49,7 @@ class ApiTypeError(OpenApiException, TypeError):
|
|
47
49
|
|
48
50
|
|
49
51
|
class ApiValueError(OpenApiException, ValueError):
|
50
|
-
def __init__(self, msg, path_to_item=None):
|
52
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
51
53
|
"""
|
52
54
|
Args:
|
53
55
|
msg (str): the exception message
|
@@ -65,7 +67,7 @@ class ApiValueError(OpenApiException, ValueError):
|
|
65
67
|
|
66
68
|
|
67
69
|
class ApiAttributeError(OpenApiException, AttributeError):
|
68
|
-
def __init__(self, msg, path_to_item=None):
|
70
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
69
71
|
"""
|
70
72
|
Raised when an attribute reference or assignment fails.
|
71
73
|
|
@@ -84,7 +86,7 @@ class ApiAttributeError(OpenApiException, AttributeError):
|
|
84
86
|
|
85
87
|
|
86
88
|
class ApiKeyError(OpenApiException, KeyError):
|
87
|
-
def __init__(self, msg, path_to_item=None):
|
89
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
88
90
|
"""
|
89
91
|
Args:
|
90
92
|
msg (str): the exception message
|
@@ -102,17 +104,56 @@ class ApiKeyError(OpenApiException, KeyError):
|
|
102
104
|
|
103
105
|
class ApiException(OpenApiException):
|
104
106
|
|
105
|
-
def __init__(
|
107
|
+
def __init__(
|
108
|
+
self,
|
109
|
+
status=None,
|
110
|
+
reason=None,
|
111
|
+
http_resp=None,
|
112
|
+
*,
|
113
|
+
body: Optional[str] = None,
|
114
|
+
data: Optional[Any] = None,
|
115
|
+
) -> None:
|
116
|
+
self.status = status
|
117
|
+
self.reason = reason
|
118
|
+
self.body = body
|
119
|
+
self.data = data
|
120
|
+
self.headers = None
|
121
|
+
|
106
122
|
if http_resp:
|
107
|
-
self.status
|
108
|
-
|
109
|
-
self.
|
123
|
+
if self.status is None:
|
124
|
+
self.status = http_resp.status
|
125
|
+
if self.reason is None:
|
126
|
+
self.reason = http_resp.reason
|
127
|
+
if self.body is None:
|
128
|
+
try:
|
129
|
+
self.body = http_resp.data.decode('utf-8')
|
130
|
+
except Exception:
|
131
|
+
pass
|
110
132
|
self.headers = http_resp.getheaders()
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
133
|
+
|
134
|
+
@classmethod
|
135
|
+
def from_response(
|
136
|
+
cls,
|
137
|
+
*,
|
138
|
+
http_resp,
|
139
|
+
body: Optional[str],
|
140
|
+
data: Optional[Any],
|
141
|
+
) -> Self:
|
142
|
+
if http_resp.status == 400:
|
143
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
144
|
+
|
145
|
+
if http_resp.status == 401:
|
146
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
147
|
+
|
148
|
+
if http_resp.status == 403:
|
149
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
150
|
+
|
151
|
+
if http_resp.status == 404:
|
152
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
153
|
+
|
154
|
+
if 500 <= http_resp.status <= 599:
|
155
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
156
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
116
157
|
|
117
158
|
def __str__(self):
|
118
159
|
"""Custom error messages for exception"""
|
@@ -122,34 +163,30 @@ class ApiException(OpenApiException):
|
|
122
163
|
error_message += "HTTP response headers: {0}\n".format(
|
123
164
|
self.headers)
|
124
165
|
|
125
|
-
if self.body:
|
126
|
-
error_message += "HTTP response body: {0}\n".format(self.body)
|
166
|
+
if self.data or self.body:
|
167
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
127
168
|
|
128
169
|
return error_message
|
129
170
|
|
130
171
|
|
131
|
-
class
|
172
|
+
class BadRequestException(ApiException):
|
173
|
+
pass
|
132
174
|
|
133
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
134
|
-
super(NotFoundException, self).__init__(status, reason, http_resp)
|
135
175
|
|
176
|
+
class NotFoundException(ApiException):
|
177
|
+
pass
|
136
178
|
|
137
|
-
class UnauthorizedException(ApiException):
|
138
179
|
|
139
|
-
|
140
|
-
|
180
|
+
class UnauthorizedException(ApiException):
|
181
|
+
pass
|
141
182
|
|
142
183
|
|
143
184
|
class ForbiddenException(ApiException):
|
144
|
-
|
145
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
146
|
-
super(ForbiddenException, self).__init__(status, reason, http_resp)
|
185
|
+
pass
|
147
186
|
|
148
187
|
|
149
188
|
class ServiceException(ApiException):
|
150
|
-
|
151
|
-
def __init__(self, status=None, reason=None, http_resp=None):
|
152
|
-
super(ServiceException, self).__init__(status, reason, http_resp)
|
189
|
+
pass
|
153
190
|
|
154
191
|
|
155
192
|
def render_path(path_to_item):
|
stadiamaps/models/__init__.py
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
"""
|
5
5
|
Stadia Maps Geospatial APIs
|
6
6
|
|
7
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
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:
|
9
|
+
The version of the OpenAPI document: 6.0.0
|
10
10
|
Contact: support@stadiamaps.com
|
11
11
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
12
12
|
|
13
13
|
Do not edit the class manually.
|
14
|
-
"""
|
14
|
+
""" # noqa: E501
|
15
15
|
|
16
16
|
|
17
17
|
# import models into model package
|
@@ -19,11 +19,9 @@ from stadiamaps.models.access import Access
|
|
19
19
|
from stadiamaps.models.admin_region import AdminRegion
|
20
20
|
from stadiamaps.models.administrative import Administrative
|
21
21
|
from stadiamaps.models.auto_costing_options import AutoCostingOptions
|
22
|
-
from stadiamaps.models.auto_costing_options_all_of import AutoCostingOptionsAllOf
|
23
22
|
from stadiamaps.models.base_costing_options import BaseCostingOptions
|
24
23
|
from stadiamaps.models.base_trace_request import BaseTraceRequest
|
25
24
|
from stadiamaps.models.bicycle_costing_options import BicycleCostingOptions
|
26
|
-
from stadiamaps.models.bicycle_costing_options_all_of import BicycleCostingOptionsAllOf
|
27
25
|
from stadiamaps.models.bike_network import BikeNetwork
|
28
26
|
from stadiamaps.models.contour import Contour
|
29
27
|
from stadiamaps.models.coordinate import Coordinate
|
@@ -38,11 +36,8 @@ from stadiamaps.models.geo_attributes import GeoAttributes
|
|
38
36
|
from stadiamaps.models.geo_json_geometry import GeoJSONGeometry
|
39
37
|
from stadiamaps.models.geo_json_geometry_base import GeoJSONGeometryBase
|
40
38
|
from stadiamaps.models.geo_json_line_string import GeoJSONLineString
|
41
|
-
from stadiamaps.models.geo_json_line_string_all_of import GeoJSONLineStringAllOf
|
42
39
|
from stadiamaps.models.geo_json_point import GeoJSONPoint
|
43
|
-
from stadiamaps.models.geo_json_point_all_of import GeoJSONPointAllOf
|
44
40
|
from stadiamaps.models.geo_json_polygon import GeoJSONPolygon
|
45
|
-
from stadiamaps.models.geo_json_polygon_all_of import GeoJSONPolygonAllOf
|
46
41
|
from stadiamaps.models.geocoding_object import GeocodingObject
|
47
42
|
from stadiamaps.models.height_request import HeightRequest
|
48
43
|
from stadiamaps.models.height_response import HeightResponse
|
@@ -57,27 +52,21 @@ from stadiamaps.models.locate_detailed_edge import LocateDetailedEdge
|
|
57
52
|
from stadiamaps.models.locate_edge import LocateEdge
|
58
53
|
from stadiamaps.models.locate_edge_info import LocateEdgeInfo
|
59
54
|
from stadiamaps.models.locate_node import LocateNode
|
60
|
-
from stadiamaps.models.locate_node_all_of import LocateNodeAllOf
|
61
55
|
from stadiamaps.models.locate_object import LocateObject
|
62
56
|
from stadiamaps.models.maneuver_sign import ManeuverSign
|
63
57
|
from stadiamaps.models.maneuver_sign_element import ManeuverSignElement
|
64
58
|
from stadiamaps.models.map_match_costing_model import MapMatchCostingModel
|
65
59
|
from stadiamaps.models.map_match_request import MapMatchRequest
|
66
|
-
from stadiamaps.models.map_match_request_all_of import MapMatchRequestAllOf
|
67
60
|
from stadiamaps.models.map_match_route_response import MapMatchRouteResponse
|
68
|
-
from stadiamaps.models.map_match_route_response_all_of import MapMatchRouteResponseAllOf
|
69
61
|
from stadiamaps.models.map_match_trace_options import MapMatchTraceOptions
|
70
62
|
from stadiamaps.models.map_match_waypoint import MapMatchWaypoint
|
71
|
-
from stadiamaps.models.map_match_waypoint_all_of import MapMatchWaypointAllOf
|
72
63
|
from stadiamaps.models.matched_point import MatchedPoint
|
73
64
|
from stadiamaps.models.matrix_costing_model import MatrixCostingModel
|
74
65
|
from stadiamaps.models.matrix_distance import MatrixDistance
|
75
66
|
from stadiamaps.models.matrix_request import MatrixRequest
|
76
67
|
from stadiamaps.models.matrix_response import MatrixResponse
|
77
68
|
from stadiamaps.models.motor_scooter_costing_options import MotorScooterCostingOptions
|
78
|
-
from stadiamaps.models.motor_scooter_costing_options_all_of import MotorScooterCostingOptionsAllOf
|
79
69
|
from stadiamaps.models.motorcycle_costing_options import MotorcycleCostingOptions
|
80
|
-
from stadiamaps.models.motorcycle_costing_options_all_of import MotorcycleCostingOptionsAllOf
|
81
70
|
from stadiamaps.models.nearest_roads_request import NearestRoadsRequest
|
82
71
|
from stadiamaps.models.node_id import NodeId
|
83
72
|
from stadiamaps.models.node_type import NodeType
|
@@ -89,7 +78,6 @@ from stadiamaps.models.pelias_geo_json_properties_addendum import PeliasGeoJSONP
|
|
89
78
|
from stadiamaps.models.pelias_geo_json_properties_addendum_osm import PeliasGeoJSONPropertiesAddendumOsm
|
90
79
|
from stadiamaps.models.pelias_layer import PeliasLayer
|
91
80
|
from stadiamaps.models.pelias_response import PeliasResponse
|
92
|
-
from stadiamaps.models.pelias_response_geocoding import PeliasResponseGeocoding
|
93
81
|
from stadiamaps.models.pelias_source import PeliasSource
|
94
82
|
from stadiamaps.models.restrictions import Restrictions
|
95
83
|
from stadiamaps.models.road_class import RoadClass
|
@@ -97,29 +85,23 @@ from stadiamaps.models.route_leg import RouteLeg
|
|
97
85
|
from stadiamaps.models.route_maneuver import RouteManeuver
|
98
86
|
from stadiamaps.models.route_request import RouteRequest
|
99
87
|
from stadiamaps.models.route_response import RouteResponse
|
100
|
-
from stadiamaps.models.
|
88
|
+
from stadiamaps.models.route_response_alternates_inner import RouteResponseAlternatesInner
|
101
89
|
from stadiamaps.models.route_summary import RouteSummary
|
90
|
+
from stadiamaps.models.route_trip import RouteTrip
|
102
91
|
from stadiamaps.models.routing_response_waypoint import RoutingResponseWaypoint
|
103
|
-
from stadiamaps.models.routing_response_waypoint_all_of import RoutingResponseWaypointAllOf
|
104
92
|
from stadiamaps.models.routing_waypoint import RoutingWaypoint
|
105
|
-
from stadiamaps.models.routing_waypoint_all_of import RoutingWaypointAllOf
|
106
93
|
from stadiamaps.models.routing_waypoint_all_of_search_filter import RoutingWaypointAllOfSearchFilter
|
107
94
|
from stadiamaps.models.simple_routing_waypoint import SimpleRoutingWaypoint
|
108
|
-
from stadiamaps.models.simple_routing_waypoint_all_of import SimpleRoutingWaypointAllOf
|
109
95
|
from stadiamaps.models.speeds import Speeds
|
110
96
|
from stadiamaps.models.trace_attribute_filter_options import TraceAttributeFilterOptions
|
111
97
|
from stadiamaps.models.trace_attribute_key import TraceAttributeKey
|
112
98
|
from stadiamaps.models.trace_attributes_base_response import TraceAttributesBaseResponse
|
113
99
|
from stadiamaps.models.trace_attributes_request import TraceAttributesRequest
|
114
|
-
from stadiamaps.models.trace_attributes_request_all_of import TraceAttributesRequestAllOf
|
115
|
-
from stadiamaps.models.trace_attributes_request_all_of_filters import TraceAttributesRequestAllOfFilters
|
116
100
|
from stadiamaps.models.trace_attributes_response import TraceAttributesResponse
|
117
|
-
from stadiamaps.models.trace_attributes_response_all_of import TraceAttributesResponseAllOf
|
118
101
|
from stadiamaps.models.trace_edge import TraceEdge
|
119
102
|
from stadiamaps.models.travel_mode import TravelMode
|
120
103
|
from stadiamaps.models.traversability import Traversability
|
121
104
|
from stadiamaps.models.truck_costing_options import TruckCostingOptions
|
122
|
-
from stadiamaps.models.truck_costing_options_all_of import TruckCostingOptionsAllOf
|
123
105
|
from stadiamaps.models.tz_response import TzResponse
|
124
106
|
from stadiamaps.models.valhalla_languages import ValhallaLanguages
|
125
107
|
from stadiamaps.models.valhalla_long_units import ValhallaLongUnits
|
stadiamaps/models/access.py
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,18 +18,19 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
24
25
|
|
25
26
|
class Access(BaseModel):
|
26
27
|
"""
|
27
28
|
Access
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
29
30
|
golf_cart: Optional[StrictBool] = None
|
30
31
|
wheelchair: Optional[StrictBool] = None
|
31
32
|
taxi: Optional[StrictBool] = None
|
32
|
-
hov: Optional[StrictBool] = Field(None, alias="HOV")
|
33
|
+
hov: Optional[StrictBool] = Field(default=None, alias="HOV")
|
33
34
|
truck: Optional[StrictBool] = None
|
34
35
|
emergency: Optional[StrictBool] = None
|
35
36
|
pedestrian: Optional[StrictBool] = None
|
@@ -39,33 +40,49 @@ class Access(BaseModel):
|
|
39
40
|
motorcycle: Optional[StrictBool] = None
|
40
41
|
moped: Optional[StrictBool] = None
|
41
42
|
additional_properties: Dict[str, Any] = {}
|
42
|
-
__properties = ["golf_cart", "wheelchair", "taxi", "HOV", "truck", "emergency", "pedestrian", "car", "bus", "bicycle", "motorcycle", "moped"]
|
43
|
+
__properties: ClassVar[List[str]] = ["golf_cart", "wheelchair", "taxi", "HOV", "truck", "emergency", "pedestrian", "car", "bus", "bicycle", "motorcycle", "moped"]
|
44
|
+
|
45
|
+
model_config = ConfigDict(
|
46
|
+
populate_by_name=True,
|
47
|
+
validate_assignment=True,
|
48
|
+
protected_namespaces=(),
|
49
|
+
)
|
43
50
|
|
44
|
-
class Config:
|
45
|
-
"""Pydantic configuration"""
|
46
|
-
allow_population_by_field_name = True
|
47
|
-
validate_assignment = True
|
48
51
|
|
49
52
|
def to_str(self) -> str:
|
50
53
|
"""Returns the string representation of the model using alias"""
|
51
|
-
return pprint.pformat(self.
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
52
55
|
|
53
56
|
def to_json(self) -> str:
|
54
57
|
"""Returns the JSON representation of the model using alias"""
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
55
59
|
return json.dumps(self.to_dict())
|
56
60
|
|
57
61
|
@classmethod
|
58
|
-
def from_json(cls, json_str: str) ->
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
59
63
|
"""Create an instance of Access from a JSON string"""
|
60
64
|
return cls.from_dict(json.loads(json_str))
|
61
65
|
|
62
|
-
def to_dict(self):
|
63
|
-
"""
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
68
|
+
|
69
|
+
This has the following differences from calling pydantic's
|
70
|
+
`self.model_dump(by_alias=True)`:
|
71
|
+
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
73
|
+
were set at model initialization. Other fields with value `None`
|
74
|
+
are ignored.
|
75
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
76
|
+
"""
|
77
|
+
excluded_fields: Set[str] = set([
|
78
|
+
"additional_properties",
|
79
|
+
])
|
80
|
+
|
81
|
+
_dict = self.model_dump(
|
82
|
+
by_alias=True,
|
83
|
+
exclude=excluded_fields,
|
84
|
+
exclude_none=True,
|
85
|
+
)
|
69
86
|
# puts key-value pairs in additional_properties in the top level
|
70
87
|
if self.additional_properties is not None:
|
71
88
|
for _key, _value in self.additional_properties.items():
|
@@ -74,19 +91,19 @@ class Access(BaseModel):
|
|
74
91
|
return _dict
|
75
92
|
|
76
93
|
@classmethod
|
77
|
-
def from_dict(cls, obj:
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
78
95
|
"""Create an instance of Access from a dict"""
|
79
96
|
if obj is None:
|
80
97
|
return None
|
81
98
|
|
82
99
|
if not isinstance(obj, dict):
|
83
|
-
return
|
100
|
+
return cls.model_validate(obj)
|
84
101
|
|
85
|
-
_obj =
|
102
|
+
_obj = cls.model_validate({
|
86
103
|
"golf_cart": obj.get("golf_cart"),
|
87
104
|
"wheelchair": obj.get("wheelchair"),
|
88
105
|
"taxi": obj.get("taxi"),
|
89
|
-
"
|
106
|
+
"HOV": obj.get("HOV"),
|
90
107
|
"truck": obj.get("truck"),
|
91
108
|
"emergency": obj.get("emergency"),
|
92
109
|
"pedestrian": obj.get("pedestrian"),
|
@@ -103,3 +120,4 @@ class Access(BaseModel):
|
|
103
120
|
|
104
121
|
return _obj
|
105
122
|
|
123
|
+
|
@@ -3,14 +3,14 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
13
|
+
""" # noqa: E501
|
14
14
|
|
15
15
|
|
16
16
|
from __future__ import annotations
|
@@ -18,46 +18,63 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
|
22
|
-
from typing import Optional
|
23
|
-
from
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
24
25
|
|
25
26
|
class AdminRegion(BaseModel):
|
26
27
|
"""
|
27
28
|
AdminRegion
|
28
|
-
"""
|
29
|
-
country_code: Optional[StrictStr] = Field(None, description="The [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.")
|
30
|
-
country_text: Optional[StrictStr] = Field(None, description="The country name")
|
31
|
-
state_code: Optional[StrictStr] = Field(None, description="The abbreviation code for the state (varies by country).")
|
32
|
-
state_text: Optional[StrictStr] = Field(None, description="The state name.")
|
29
|
+
""" # noqa: E501
|
30
|
+
country_code: Optional[StrictStr] = Field(default=None, description="The [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.")
|
31
|
+
country_text: Optional[StrictStr] = Field(default=None, description="The country name")
|
32
|
+
state_code: Optional[StrictStr] = Field(default=None, description="The abbreviation code for the state (varies by country).")
|
33
|
+
state_text: Optional[StrictStr] = Field(default=None, description="The state name.")
|
33
34
|
additional_properties: Dict[str, Any] = {}
|
34
|
-
__properties = ["country_code", "country_text", "state_code", "state_text"]
|
35
|
+
__properties: ClassVar[List[str]] = ["country_code", "country_text", "state_code", "state_text"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
35
42
|
|
36
|
-
class Config:
|
37
|
-
"""Pydantic configuration"""
|
38
|
-
allow_population_by_field_name = True
|
39
|
-
validate_assignment = True
|
40
43
|
|
41
44
|
def to_str(self) -> str:
|
42
45
|
"""Returns the string representation of the model using alias"""
|
43
|
-
return pprint.pformat(self.
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
44
47
|
|
45
48
|
def to_json(self) -> str:
|
46
49
|
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
47
51
|
return json.dumps(self.to_dict())
|
48
52
|
|
49
53
|
@classmethod
|
50
|
-
def from_json(cls, json_str: str) ->
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
51
55
|
"""Create an instance of AdminRegion from a JSON string"""
|
52
56
|
return cls.from_dict(json.loads(json_str))
|
53
57
|
|
54
|
-
def to_dict(self):
|
55
|
-
"""
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
68
|
+
"""
|
69
|
+
excluded_fields: Set[str] = set([
|
70
|
+
"additional_properties",
|
71
|
+
])
|
72
|
+
|
73
|
+
_dict = self.model_dump(
|
74
|
+
by_alias=True,
|
75
|
+
exclude=excluded_fields,
|
76
|
+
exclude_none=True,
|
77
|
+
)
|
61
78
|
# puts key-value pairs in additional_properties in the top level
|
62
79
|
if self.additional_properties is not None:
|
63
80
|
for _key, _value in self.additional_properties.items():
|
@@ -66,15 +83,15 @@ class AdminRegion(BaseModel):
|
|
66
83
|
return _dict
|
67
84
|
|
68
85
|
@classmethod
|
69
|
-
def from_dict(cls, obj:
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
70
87
|
"""Create an instance of AdminRegion from a dict"""
|
71
88
|
if obj is None:
|
72
89
|
return None
|
73
90
|
|
74
91
|
if not isinstance(obj, dict):
|
75
|
-
return
|
92
|
+
return cls.model_validate(obj)
|
76
93
|
|
77
|
-
_obj =
|
94
|
+
_obj = cls.model_validate({
|
78
95
|
"country_code": obj.get("country_code"),
|
79
96
|
"country_text": obj.get("country_text"),
|
80
97
|
"state_code": obj.get("state_code"),
|
@@ -87,3 +104,4 @@ class AdminRegion(BaseModel):
|
|
87
104
|
|
88
105
|
return _obj
|
89
106
|
|
107
|
+
|