stadiamaps 3.0.0__py3-none-any.whl → 3.1.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 CHANGED
@@ -15,7 +15,7 @@
15
15
  """ # noqa: E501
16
16
 
17
17
 
18
- __version__ = "3.0.0"
18
+ __version__ = "3.1.0"
19
19
 
20
20
  # import apis into sdk package
21
21
  from stadiamaps.api.geocoding_api import GeocodingApi
@@ -458,7 +458,7 @@ class GeocodingApi:
458
458
  _query_params: List[Tuple[str, str]] = []
459
459
  _header_params: Dict[str, Optional[str]] = _headers or {}
460
460
  _form_params: List[Tuple[str, str]] = []
461
- _files: Dict[str, str] = {}
461
+ _files: Dict[str, Union[str, bytes]] = {}
462
462
  _body_params: Optional[bytes] = None
463
463
 
464
464
  # process the path parameters
@@ -795,7 +795,7 @@ class GeocodingApi:
795
795
  _query_params: List[Tuple[str, str]] = []
796
796
  _header_params: Dict[str, Optional[str]] = _headers or {}
797
797
  _form_params: List[Tuple[str, str]] = []
798
- _files: Dict[str, str] = {}
798
+ _files: Dict[str, Union[str, bytes]] = {}
799
799
  _body_params: Optional[bytes] = None
800
800
 
801
801
  # process the path parameters
@@ -1169,7 +1169,7 @@ class GeocodingApi:
1169
1169
  _query_params: List[Tuple[str, str]] = []
1170
1170
  _header_params: Dict[str, Optional[str]] = _headers or {}
1171
1171
  _form_params: List[Tuple[str, str]] = []
1172
- _files: Dict[str, str] = {}
1172
+ _files: Dict[str, Union[str, bytes]] = {}
1173
1173
  _body_params: Optional[bytes] = None
1174
1174
 
1175
1175
  # process the path parameters
@@ -1662,7 +1662,7 @@ class GeocodingApi:
1662
1662
  _query_params: List[Tuple[str, str]] = []
1663
1663
  _header_params: Dict[str, Optional[str]] = _headers or {}
1664
1664
  _form_params: List[Tuple[str, str]] = []
1665
- _files: Dict[str, str] = {}
1665
+ _files: Dict[str, Union[str, bytes]] = {}
1666
1666
  _body_params: Optional[bytes] = None
1667
1667
 
1668
1668
  # process the path parameters
@@ -2274,7 +2274,7 @@ class GeocodingApi:
2274
2274
  _query_params: List[Tuple[str, str]] = []
2275
2275
  _header_params: Dict[str, Optional[str]] = _headers or {}
2276
2276
  _form_params: List[Tuple[str, str]] = []
2277
- _files: Dict[str, str] = {}
2277
+ _files: Dict[str, Union[str, bytes]] = {}
2278
2278
  _body_params: Optional[bytes] = None
2279
2279
 
2280
2280
  # process the path parameters
@@ -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
@@ -560,7 +560,7 @@ class GeospatialApi:
560
560
  _query_params: List[Tuple[str, str]] = []
561
561
  _header_params: Dict[str, Optional[str]] = _headers or {}
562
562
  _form_params: List[Tuple[str, str]] = []
563
- _files: Dict[str, str] = {}
563
+ _files: Dict[str, Union[str, bytes]] = {}
564
564
  _body_params: Optional[bytes] = None
565
565
 
566
566
  # process the path parameters
@@ -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
@@ -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
@@ -545,7 +545,7 @@ class RoutingApi:
545
545
  _query_params: List[Tuple[str, str]] = []
546
546
  _header_params: Dict[str, Optional[str]] = _headers or {}
547
547
  _form_params: List[Tuple[str, str]] = []
548
- _files: Dict[str, str] = {}
548
+ _files: Dict[str, Union[str, bytes]] = {}
549
549
  _body_params: Optional[bytes] = None
550
550
 
551
551
  # process the path parameters
@@ -819,7 +819,7 @@ class RoutingApi:
819
819
  _query_params: List[Tuple[str, str]] = []
820
820
  _header_params: Dict[str, Optional[str]] = _headers or {}
821
821
  _form_params: List[Tuple[str, str]] = []
822
- _files: Dict[str, str] = {}
822
+ _files: Dict[str, Union[str, bytes]] = {}
823
823
  _body_params: Optional[bytes] = None
824
824
 
825
825
  # process the path parameters
@@ -1096,7 +1096,7 @@ class RoutingApi:
1096
1096
  _query_params: List[Tuple[str, str]] = []
1097
1097
  _header_params: Dict[str, Optional[str]] = _headers or {}
1098
1098
  _form_params: List[Tuple[str, str]] = []
1099
- _files: Dict[str, str] = {}
1099
+ _files: Dict[str, Union[str, bytes]] = {}
1100
1100
  _body_params: Optional[bytes] = None
1101
1101
 
1102
1102
  # process the path parameters
@@ -1373,7 +1373,7 @@ class RoutingApi:
1373
1373
  _query_params: List[Tuple[str, str]] = []
1374
1374
  _header_params: Dict[str, Optional[str]] = _headers or {}
1375
1375
  _form_params: List[Tuple[str, str]] = []
1376
- _files: Dict[str, str] = {}
1376
+ _files: Dict[str, Union[str, bytes]] = {}
1377
1377
  _body_params: Optional[bytes] = None
1378
1378
 
1379
1379
  # process the path parameters
@@ -1448,7 +1448,7 @@ class RoutingApi:
1448
1448
  ) -> MatrixResponse:
1449
1449
  """Calculate a time distance matrix for use in an optimizer.
1450
1450
 
1451
- The time distance matrix API lets you compare travel times between a set of possible start and end points. Note that this endpoint has a limit of 22,500 elements, regardless of the costing/mode of travel. A matrix request with 3 inputs and 5 outputs has 3 x 5 = 15 elements. For example, a matrix request with 3 inputs and 5 outputs has 3 x 5 = 15 elements. This means you could send a 150 x 150 or 30 x 750 matrix request (each having 22,500 elements), but not a 500 x 500 matrix (250,000 elements).
1451
+ 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
1452
 
1453
1453
  :param matrix_request:
1454
1454
  :type matrix_request: MatrixRequest
@@ -1516,7 +1516,7 @@ class RoutingApi:
1516
1516
  ) -> ApiResponse[MatrixResponse]:
1517
1517
  """Calculate a time distance matrix for use in an optimizer.
1518
1518
 
1519
- The time distance matrix API lets you compare travel times between a set of possible start and end points. Note that this endpoint has a limit of 22,500 elements, regardless of the costing/mode of travel. A matrix request with 3 inputs and 5 outputs has 3 x 5 = 15 elements. For example, a matrix request with 3 inputs and 5 outputs has 3 x 5 = 15 elements. This means you could send a 150 x 150 or 30 x 750 matrix request (each having 22,500 elements), but not a 500 x 500 matrix (250,000 elements).
1519
+ 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
1520
 
1521
1521
  :param matrix_request:
1522
1522
  :type matrix_request: MatrixRequest
@@ -1584,7 +1584,7 @@ class RoutingApi:
1584
1584
  ) -> RESTResponseType:
1585
1585
  """Calculate a time distance matrix for use in an optimizer.
1586
1586
 
1587
- The time distance matrix API lets you compare travel times between a set of possible start and end points. Note that this endpoint has a limit of 22,500 elements, regardless of the costing/mode of travel. A matrix request with 3 inputs and 5 outputs has 3 x 5 = 15 elements. For example, a matrix request with 3 inputs and 5 outputs has 3 x 5 = 15 elements. This means you could send a 150 x 150 or 30 x 750 matrix request (each having 22,500 elements), but not a 500 x 500 matrix (250,000 elements).
1587
+ 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
1588
 
1589
1589
  :param matrix_request:
1590
1590
  :type matrix_request: MatrixRequest
@@ -1647,7 +1647,7 @@ class RoutingApi:
1647
1647
  _query_params: List[Tuple[str, str]] = []
1648
1648
  _header_params: Dict[str, Optional[str]] = _headers or {}
1649
1649
  _form_params: List[Tuple[str, str]] = []
1650
- _files: Dict[str, str] = {}
1650
+ _files: Dict[str, Union[str, bytes]] = {}
1651
1651
  _body_params: Optional[bytes] = None
1652
1652
 
1653
1653
  # process the path parameters
@@ -1921,7 +1921,7 @@ class RoutingApi:
1921
1921
  _query_params: List[Tuple[str, str]] = []
1922
1922
  _header_params: Dict[str, Optional[str]] = _headers or {}
1923
1923
  _form_params: List[Tuple[str, str]] = []
1924
- _files: Dict[str, str] = {}
1924
+ _files: Dict[str, Union[str, bytes]] = {}
1925
1925
  _body_params: Optional[bytes] = None
1926
1926
 
1927
1927
  # process the path parameters
stadiamaps/api_client.py CHANGED
@@ -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.0.0/python'
92
+ self.user_agent = 'OpenAPI-Generator/3.1.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
- post_params.extend(self.files_parameters(files))
212
+ if files:
213
+ post_params.extend(self.files_parameters(files))
212
214
 
213
215
  # auth setting
214
216
  self.update_params_for_auth(
@@ -313,7 +315,10 @@ 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
+ if response_type in ["bytearray", "str"]:
319
+ return_data = self.__deserialize_primitive(response_text, response_type)
320
+ else:
321
+ return_data = self.deserialize(response_text, response_type)
317
322
  finally:
318
323
  if not 200 <= response_data.status <= 299:
319
324
  raise ApiException.from_response(
@@ -333,6 +338,7 @@ class ApiClient:
333
338
  """Builds a JSON POST object.
334
339
 
335
340
  If obj is None, return None.
341
+ If obj is SecretStr, return obj.get_secret_value()
336
342
  If obj is str, int, long, float, bool, return directly.
337
343
  If obj is datetime.datetime, datetime.date
338
344
  convert to string in iso8601 format.
@@ -345,6 +351,10 @@ class ApiClient:
345
351
  """
346
352
  if obj is None:
347
353
  return None
354
+ elif isinstance(obj, Enum):
355
+ return obj.value
356
+ elif isinstance(obj, SecretStr):
357
+ return obj.get_secret_value()
348
358
  elif isinstance(obj, self.PRIMITIVE_TYPES):
349
359
  return obj
350
360
  elif isinstance(obj, list):
@@ -366,7 +376,10 @@ class ApiClient:
366
376
  # and attributes which value is not None.
367
377
  # Convert attribute name to json key in
368
378
  # model definition for request.
369
- obj_dict = obj.to_dict()
379
+ if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
380
+ obj_dict = obj.to_dict()
381
+ else:
382
+ obj_dict = obj.__dict__
370
383
 
371
384
  return {
372
385
  key: self.sanitize_for_serialization(val)
@@ -481,8 +494,6 @@ class ApiClient:
481
494
  v = str(v).lower()
482
495
  if isinstance(v, (int, float)):
483
496
  v = str(v)
484
- if isinstance(v, Enum):
485
- v = str(v.value)
486
497
  if isinstance(v, dict):
487
498
  v = json.dumps(v)
488
499
 
@@ -500,38 +511,37 @@ class ApiClient:
500
511
  else: # csv is the default
501
512
  delimiter = ','
502
513
  new_params.append(
503
- (k, delimiter.join(quote(str(value.value) if isinstance(value, Enum) else str(value)) for value in v))
514
+ (k, delimiter.join(quote(str(value)) for value in v))
504
515
  )
505
516
  else:
506
517
  new_params.append((k, quote(str(v))))
507
518
 
508
519
  return "&".join(["=".join(map(str, item)) for item in new_params])
509
520
 
510
- def files_parameters(self, files=None):
521
+ def files_parameters(self, files: Dict[str, Union[str, bytes]]):
511
522
  """Builds form parameters.
512
523
 
513
524
  :param files: File parameters.
514
525
  :return: Form parameters with files.
515
526
  """
516
527
  params = []
517
-
518
- if files:
519
- for k, v in files.items():
520
- if not v:
521
- continue
522
- file_names = v if type(v) is list else [v]
523
- for n in file_names:
524
- with open(n, 'rb') as f:
525
- filename = os.path.basename(f.name)
526
- filedata = f.read()
527
- mimetype = (
528
- mimetypes.guess_type(filename)[0]
529
- or 'application/octet-stream'
530
- )
531
- params.append(
532
- tuple([k, tuple([filename, filedata, mimetype])])
533
- )
534
-
528
+ for k, v in files.items():
529
+ if isinstance(v, str):
530
+ with open(v, 'rb') as f:
531
+ filename = os.path.basename(f.name)
532
+ filedata = f.read()
533
+ elif isinstance(v, bytes):
534
+ filename = k
535
+ filedata = v
536
+ else:
537
+ raise ValueError("Unsupported file value")
538
+ mimetype = (
539
+ mimetypes.guess_type(filename)[0]
540
+ or 'application/octet-stream'
541
+ )
542
+ params.append(
543
+ tuple([k, tuple([filename, filedata, mimetype])])
544
+ )
535
545
  return params
536
546
 
537
547
  def select_header_accept(self, accepts: List[str]) -> Optional[str]:
@@ -400,7 +400,7 @@ conf = stadiamaps.Configuration(
400
400
  "OS: {env}\n"\
401
401
  "Python Version: {pyversion}\n"\
402
402
  "Version of the API: 6.3.0\n"\
403
- "SDK Package Version: 3.0.0".\
403
+ "SDK Package Version: 3.1.0".\
404
404
  format(env=sys.platform, pyversion=sys.version)
405
405
 
406
406
  def get_host_settings(self):
@@ -22,7 +22,7 @@ from stadiamaps.models.geo_json_line_string import GeoJSONLineString
22
22
  from stadiamaps.models.geo_json_point import GeoJSONPoint
23
23
  from stadiamaps.models.geo_json_polygon import GeoJSONPolygon
24
24
  from pydantic import StrictStr, Field
25
- from typing import Union, List, Optional, Dict
25
+ from typing import Union, List, Set, Optional, Dict
26
26
  from typing_extensions import Literal, Self
27
27
 
28
28
  GEOJSONGEOMETRY_ONE_OF_SCHEMAS = ["GeoJSONLineString", "GeoJSONPoint", "GeoJSONPolygon"]
@@ -38,7 +38,7 @@ class GeoJSONGeometry(BaseModel):
38
38
  # data type: GeoJSONPolygon
39
39
  oneof_schema_3_validator: Optional[GeoJSONPolygon] = None
40
40
  actual_instance: Optional[Union[GeoJSONLineString, GeoJSONPoint, GeoJSONPolygon]] = None
41
- one_of_schemas: List[str] = Field(default=Literal["GeoJSONLineString", "GeoJSONPoint", "GeoJSONPolygon"])
41
+ one_of_schemas: Set[str] = { "GeoJSONLineString", "GeoJSONPoint", "GeoJSONPolygon" }
42
42
 
43
43
  model_config = ConfigDict(
44
44
  validate_assignment=True,
@@ -33,8 +33,8 @@ class MatrixResponse(BaseModel):
33
33
  MatrixResponse
34
34
  """ # noqa: E501
35
35
  id: Optional[StrictStr] = Field(default=None, description="An identifier to disambiguate requests (echoed by the server).")
36
- sources: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of starting locations")
37
- targets: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of ending locations")
36
+ sources: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of starting locations determined by snapping to the nearest appropriate point on the road network for the costing model. All locations appear in the same order as the input.")
37
+ targets: Annotated[List[Coordinate], Field(min_length=1)] = Field(description="The list of ending locations determined by snapping to the nearest appropriate point on the road network for the costing model. All locations appear in the same order as the input.")
38
38
  sources_to_targets: Annotated[List[List[MatrixDistance]], Field(min_length=1)] = Field(description="The matrix of starting and ending locations, along with the computed distance and travel time. The array is row-ordered. This means that the time and distance from the first location to all others forms the first row of the array, followed by the time and distance from the second source location to all target locations, etc.")
39
39
  warnings: Optional[List[Warning]] = None
40
40
  units: ValhallaLongUnits
@@ -18,8 +18,8 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
- from typing import Any, ClassVar, Dict, List
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
23
  from typing_extensions import Annotated
24
24
  from stadiamaps.models.route_maneuver import RouteManeuver
25
25
  from stadiamaps.models.route_summary import RouteSummary
@@ -33,8 +33,10 @@ class RouteLeg(BaseModel):
33
33
  maneuvers: Annotated[List[RouteManeuver], Field(min_length=1)]
34
34
  shape: StrictStr = Field(description="An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) with 6 digits of decimal precision.")
35
35
  summary: RouteSummary
36
+ elevation_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The sampling distance between elevation values along the route. This echoes the request parameter having the same name.")
37
+ elevation: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="An array of elevation values sampled every `elevation_interval`. Units are either metric or imperial depending on the value of `units`.")
36
38
  additional_properties: Dict[str, Any] = {}
37
- __properties: ClassVar[List[str]] = ["maneuvers", "shape", "summary"]
39
+ __properties: ClassVar[List[str]] = ["maneuvers", "shape", "summary", "elevation_interval", "elevation"]
38
40
 
39
41
  model_config = ConfigDict(
40
42
  populate_by_name=True,
@@ -106,7 +108,9 @@ class RouteLeg(BaseModel):
106
108
  _obj = cls.model_validate({
107
109
  "maneuvers": [RouteManeuver.from_dict(_item) for _item in obj["maneuvers"]] if obj.get("maneuvers") is not None else None,
108
110
  "shape": obj.get("shape"),
109
- "summary": RouteSummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None
111
+ "summary": RouteSummary.from_dict(obj["summary"]) if obj.get("summary") is not None else None,
112
+ "elevation_interval": obj.get("elevation_interval"),
113
+ "elevation": obj.get("elevation")
110
114
  })
111
115
  # store additional fields in additional_properties
112
116
  for _key in obj.keys():
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
23
  from typing_extensions import Annotated
24
24
  from stadiamaps.models.costing_model import CostingModel
@@ -43,8 +43,10 @@ class RouteRequest(BaseModel):
43
43
  exclude_locations: Optional[List[RoutingWaypoint]] = Field(default=None, description="This has the same format as the locations list. Locations are mapped to the closed road(s), and these road(s) are excluded from the route path computation.")
44
44
  exclude_polygons: Optional[List[List[List[Union[StrictFloat, StrictInt]]]]] = Field(default=None, description="One or multiple exterior rings of polygons in the form of nested JSON arrays. Roads intersecting these rings will be avoided during path finding. Open rings will be closed automatically. If you only need to avoid a few specific roads, it's much more efficient to use `exclude_locations`.")
45
45
  alternates: Optional[StrictInt] = Field(default=None, description="How many alternate routes are desired. Note that fewer or no alternates may be returned. Alternates are not yet supported on routes with more than 2 locations or on time-dependent routes.")
46
+ elevation_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.0, description="If greater than zero, attempts to include elevation along the route at regular intervals. The \"native\" internal resolution is 30m, so we recommend you use this when possible. This number is interpreted as either meters or feet depending on the unit parameter. Elevation for route sections containing a bridge or tunnel is interpolated linearly. This doesn't always match the true elevation of the bridge/tunnel, but it prevents sharp artifacts from the surrounding terrain. This functionality is unique to the route endpoint and is not available via the elevation API.")
47
+ roundabout_exits: Optional[StrictBool] = Field(default=True, description="Determines whether the output should include roundabout exit instructions.")
46
48
  additional_properties: Dict[str, Any] = {}
47
- __properties: ClassVar[List[str]] = ["units", "language", "directions_type", "id", "locations", "costing", "costing_options", "exclude_locations", "exclude_polygons", "alternates"]
49
+ __properties: ClassVar[List[str]] = ["units", "language", "directions_type", "id", "locations", "costing", "costing_options", "exclude_locations", "exclude_polygons", "alternates", "elevation_interval", "roundabout_exits"]
48
50
 
49
51
  @field_validator('directions_type')
50
52
  def directions_type_validate_enum(cls, value):
@@ -140,7 +142,9 @@ class RouteRequest(BaseModel):
140
142
  "costing_options": CostingOptions.from_dict(obj["costing_options"]) if obj.get("costing_options") is not None else None,
141
143
  "exclude_locations": [RoutingWaypoint.from_dict(_item) for _item in obj["exclude_locations"]] if obj.get("exclude_locations") is not None else None,
142
144
  "exclude_polygons": obj.get("exclude_polygons"),
143
- "alternates": obj.get("alternates")
145
+ "alternates": obj.get("alternates"),
146
+ "elevation_interval": obj.get("elevation_interval") if obj.get("elevation_interval") is not None else 0.0,
147
+ "roundabout_exits": obj.get("roundabout_exits") if obj.get("roundabout_exits") is not None else True
144
148
  })
145
149
  # store additional fields in additional_properties
146
150
  for _key in obj.keys():
stadiamaps/rest.py CHANGED
@@ -203,6 +203,8 @@ class RESTClientObject:
203
203
  # Content-Type which generated by urllib3 will be
204
204
  # overwritten.
205
205
  del headers['Content-Type']
206
+ # Ensures that dict objects are serialized
207
+ post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
206
208
  r = self.pool_manager.request(
207
209
  method,
208
210
  url,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stadiamaps
3
- Version: 3.0.0
3
+ Version: 3.1.0
4
4
  Summary: Stadia Maps Geospatial APIs
5
5
  Home-page: https://github.com/stadiamaps/stadiamaps-api-py
6
6
  Author: Stadia Maps Support
@@ -1,14 +1,14 @@
1
- stadiamaps/__init__.py,sha256=FUnGRwNZ6EUSz7dAh4LUuutjbg0KcYNVzrCIpnHOt6Y,7151
2
- stadiamaps/api_client.py,sha256=IxgF2KdwZj27MvxNf3z_2i-UyxWy6jdFKy5W1xoUufs,25932
1
+ stadiamaps/__init__.py,sha256=DJayUKTNTZwV3Uue0VytfWGcfKZh9pG4ke_jITlUEKg,7151
2
+ stadiamaps/api_client.py,sha256=YLE-OrXydl4EJaZl_dwfJAIeK1Ccy9CMzwgmeiOPv5g,26365
3
3
  stadiamaps/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
4
- stadiamaps/configuration.py,sha256=hjlKbcus5RIEVDEcRhzIdvFP2ZTwkzGSricEbSXNEho,15562
4
+ stadiamaps/configuration.py,sha256=EjD0jrBIvXSJrIRi6xB4raOJ7pDW1xPGfT_H-rCVrvo,15562
5
5
  stadiamaps/exceptions.py,sha256=A28HV9u55ZUqMlKsG8NChMAE0dTLqZY64B-eWv3oVyE,6019
6
6
  stadiamaps/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- stadiamaps/rest.py,sha256=aTtPEYn67hAnKB_FP8BdyqSevfD1qIMt55_nuImXEzs,9275
7
+ stadiamaps/rest.py,sha256=WRF-YkRqa0mEpuQEqpUC6RdyHPW_9p1nYGLx8DlHS1k,9451
8
8
  stadiamaps/api/__init__.py,sha256=NRdfWLDRL2TYgITiS6K4OX8lmmVVmf9-_yyMe2_6hTs,208
9
- stadiamaps/api/geocoding_api.py,sha256=9OrvAt3HugGgjJ1e1HE5BpKRALQczeJnxyscftzccJc,147742
10
- stadiamaps/api/geospatial_api.py,sha256=tE0FQ7a1z5nGbwzq0JC8MO3SSJH2XsRIXHmn4HJ1Tsk,29289
11
- stadiamaps/api/routing_api.py,sha256=JxnYXspzCPkXL8AM_4jRPbPPBHtyBgg398oFHJFDxwo,80984
9
+ stadiamaps/api/geocoding_api.py,sha256=csbF9XKazAdKAe3cZH4Y4sjBH7qYiMJiUxWd0BxmyeU,147812
10
+ stadiamaps/api/geospatial_api.py,sha256=FYwfcYawNHtR9NBip3IAEItSQYIcEVcuZpIrGYkaGd8,29317
11
+ stadiamaps/api/routing_api.py,sha256=al28Kpnedp2wDN6sW6Bu6JtqLfZBeI6T_wy45LbZA3E,80146
12
12
  stadiamaps/models/__init__.py,sha256=gfknKrvXC02sdmzjVS7kvWCKL15I1JarbbypIbb1zmw,6483
13
13
  stadiamaps/models/access.py,sha256=zBDgvPSpnu6svKPUUbthG7gDGfAM_xzTfot4YROCBdk,4179
14
14
  stadiamaps/models/admin_region.py,sha256=_uOsfsEcY-k0do1hnUucOT_nYD67WdbJ59p-N2-URVI,3793
@@ -30,7 +30,7 @@ stadiamaps/models/edge_sign.py,sha256=A_WktdZmBS2dktcQ1k46-9mG22TR3eNLd671F5Qavp
30
30
  stadiamaps/models/edge_use.py,sha256=WyIA6oExIaSpVwDsorg47_u8XNXUOWwc472qjB0FYAg,1663
31
31
  stadiamaps/models/end_node.py,sha256=JnRuL4HJd16DOGuspuW4WCvM0ePzmOu3BQnZC0rVsnc,4718
32
32
  stadiamaps/models/geo_attributes.py,sha256=_h5sPD2CMhueYn5pFb2HhkNtJvqSDWgp0PN7JkDUcfM,4213
33
- stadiamaps/models/geo_json_geometry.py,sha256=ajfw3XUYNFLzxvQCN_Z24VoQBX1RT8LxuYdhKTKPqoA,6217
33
+ stadiamaps/models/geo_json_geometry.py,sha256=df95lD81Zt9cPIHhCwOu5bZ32HmwW_FWQmdKi_G5zeQ,6201
34
34
  stadiamaps/models/geo_json_geometry_base.py,sha256=rikruacdmawnky1CtlKkpNXSzAygXamon6M9STLpCoY,3532
35
35
  stadiamaps/models/geo_json_line_string.py,sha256=1362s4qRXJznMefQdAc0JquQdBYzpAYLc-uzd-Q02kE,3773
36
36
  stadiamaps/models/geo_json_line_string_all_of.py,sha256=_vHsj7n-c1QEAoL9M8MAWj7Q1wv4AtqpG0lXHluRYzA,2663
@@ -69,7 +69,7 @@ stadiamaps/models/matched_point.py,sha256=og6O9y1NB2PUfv4XqTjzAzcrSsnOhhBJ2r-5mV
69
69
  stadiamaps/models/matrix_costing_model.py,sha256=DgNlgQfgFEtFVPpNvUddiALdurtMv3AFZjjX1H9MltY,1034
70
70
  stadiamaps/models/matrix_distance.py,sha256=ZuUWw5KkjEk1Ea0LSV2bMG8gHOj3TavyKfrSk-IxS4Y,4571
71
71
  stadiamaps/models/matrix_request.py,sha256=AudHB72VJF4ALI_PA0R1rOXLWZY4C-9EKaV6be9SyZI,6656
72
- stadiamaps/models/matrix_response.py,sha256=pVkF3_hUoXprnZH062exl_B-IduixSCRNcPUWvl3OKM,6356
72
+ stadiamaps/models/matrix_response.py,sha256=hVUekXozDU_JSHtF1c4fNfiwLSupK1U7FqUoKqm8qbg,6660
73
73
  stadiamaps/models/matrix_waypoint.py,sha256=r66r-R4-ahqIvYH8hLbVJkQZJpIZMIWOo0DrPXbUDc4,3878
74
74
  stadiamaps/models/motor_scooter_costing_options.py,sha256=81YuArggR75qrxn4wK26KDrJN1dw4x7Ngij_Y81MJqg,13848
75
75
  stadiamaps/models/motor_scooter_costing_options_all_of.py,sha256=3XuHRpUB_VvAro0XZwCbq1ExJbEMnB5cm6iagIruuP4,3525
@@ -90,9 +90,9 @@ stadiamaps/models/pelias_response_geocoding.py,sha256=KPrpxVWAvd6U0lZCcsHA2WI29I
90
90
  stadiamaps/models/pelias_source.py,sha256=kheD7bVZHSsdSvHOhOo7z8OttyqjN0L9GZKNaTghuuM,1023
91
91
  stadiamaps/models/restrictions.py,sha256=frJPMuQsUaknh_sr6zfZUkDvl1DxJ50sfwp3vWWcwoY,4203
92
92
  stadiamaps/models/road_class.py,sha256=Kg_-Wsp12L4t7WTCEEnsUyWRwpG0MpV8Bml37W7mHsk,1002
93
- stadiamaps/models/route_leg.py,sha256=nvhTBR0TZjSCg58w1cHppm7G0c9x8mZMMssiZH-D_H8,4252
93
+ stadiamaps/models/route_leg.py,sha256=CDL9HfNO6KSzpfE3kZN9v8DccwpqAe8yHbxqubZXfWE,4895
94
94
  stadiamaps/models/route_maneuver.py,sha256=vEXnSGUpc9ZoM8n8Iar0Jlo9Zew-8UOAxLhSV_ES5FY,12445
95
- stadiamaps/models/route_request.py,sha256=ZynVranBtD8K9KnMhUUv8Y1_b6IAB2gb8xuUYwvFk14,7169
95
+ stadiamaps/models/route_request.py,sha256=0StM1nVsgMb2p1y4Z3RkYs0tFRKKZqiYCZwaXJDX6d0,8282
96
96
  stadiamaps/models/route_response.py,sha256=q557aHSJX46nLecPXnnvxDYBwaluB_nx6QvkynskJKo,4199
97
97
  stadiamaps/models/route_response_alternates_inner.py,sha256=YD-JVFAaU4czddJraKSqrzFGNTBFbAwrFwm44_6VD1E,3448
98
98
  stadiamaps/models/route_response_trip.py,sha256=dArv_kidtG7keQJCrRXRP5GqTaSXJMBMd_MgGbR125I,4565
@@ -123,8 +123,8 @@ stadiamaps/models/tz_response.py,sha256=M9qu8xdpVijGjO8C4bFXUE22LeOAqbTSB_ufMDlU
123
123
  stadiamaps/models/valhalla_languages.py,sha256=6ytlmq3w31rNHPUMwgY_SCGkVAk-9k9xrbV90ih5vFY,1551
124
124
  stadiamaps/models/valhalla_long_units.py,sha256=Oeeaqdpvm2vh45nMmjuz3KcFfvxKL4SDk_65tVazQ0Q,817
125
125
  stadiamaps/models/warning.py,sha256=hbS23tth42pdXEzhaADecCUOyNwnMG8fEiDuzjDULwU,3206
126
- stadiamaps-3.0.0.dist-info/LICENSE.txt,sha256=vs0H95Mi3Rf1pSskD7rv4KbXLYCSYZ6cqZcFmek0hOg,1518
127
- stadiamaps-3.0.0.dist-info/METADATA,sha256=AykUOPlPJKNCPF_NoXAEllBvvn9e8nl0hZsJfvjORCY,2455
128
- stadiamaps-3.0.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
129
- stadiamaps-3.0.0.dist-info/top_level.txt,sha256=dFHpcPo1v2Ajmc74F29BleqU5u8MLB0fgTnNYJIatx0,11
130
- stadiamaps-3.0.0.dist-info/RECORD,,
126
+ stadiamaps-3.1.0.dist-info/LICENSE.txt,sha256=vs0H95Mi3Rf1pSskD7rv4KbXLYCSYZ6cqZcFmek0hOg,1518
127
+ stadiamaps-3.1.0.dist-info/METADATA,sha256=whMx6MxZfFi7essaxVmx-aQiGA0Su7CVGU4DZJEkDJY,2455
128
+ stadiamaps-3.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
129
+ stadiamaps-3.1.0.dist-info/top_level.txt,sha256=dFHpcPo1v2Ajmc74F29BleqU5u8MLB0fgTnNYJIatx0,11
130
+ stadiamaps-3.1.0.dist-info/RECORD,,