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.
Files changed (128) hide show
  1. stadiamaps/__init__.py +6 -24
  2. stadiamaps/api/geocoding_api.py +1917 -760
  3. stadiamaps/api/geospatial_api.py +483 -221
  4. stadiamaps/api/routing_api.py +1615 -723
  5. stadiamaps/api_client.py +275 -272
  6. stadiamaps/api_response.py +12 -16
  7. stadiamaps/configuration.py +13 -11
  8. stadiamaps/exceptions.py +67 -30
  9. stadiamaps/models/__init__.py +5 -23
  10. stadiamaps/models/access.py +44 -26
  11. stadiamaps/models/admin_region.py +46 -28
  12. stadiamaps/models/administrative.py +48 -30
  13. stadiamaps/models/auto_costing_options.py +69 -48
  14. stadiamaps/models/auto_costing_options_all_of.py +1 -1
  15. stadiamaps/models/base_costing_options.py +52 -33
  16. stadiamaps/models/base_trace_request.py +70 -40
  17. stadiamaps/models/bicycle_costing_options.py +61 -42
  18. stadiamaps/models/bicycle_costing_options_all_of.py +1 -1
  19. stadiamaps/models/bike_network.py +42 -24
  20. stadiamaps/models/contour.py +45 -27
  21. stadiamaps/models/coordinate.py +45 -26
  22. stadiamaps/models/costing_model.py +10 -12
  23. stadiamaps/models/costing_options.py +51 -33
  24. stadiamaps/models/directions_options.py +45 -27
  25. stadiamaps/models/distance_unit.py +8 -11
  26. stadiamaps/models/edge_sign.py +46 -28
  27. stadiamaps/models/edge_use.py +8 -11
  28. stadiamaps/models/end_node.py +48 -30
  29. stadiamaps/models/geo_attributes.py +47 -29
  30. stadiamaps/models/geo_json_geometry.py +25 -25
  31. stadiamaps/models/geo_json_geometry_base.py +45 -27
  32. stadiamaps/models/geo_json_line_string.py +47 -28
  33. stadiamaps/models/geo_json_line_string_all_of.py +2 -2
  34. stadiamaps/models/geo_json_point.py +47 -28
  35. stadiamaps/models/geo_json_point_all_of.py +2 -2
  36. stadiamaps/models/geo_json_polygon.py +47 -28
  37. stadiamaps/models/geo_json_polygon_all_of.py +2 -2
  38. stadiamaps/models/geocoding_object.py +46 -28
  39. stadiamaps/models/height_request.py +55 -34
  40. stadiamaps/models/height_response.py +49 -30
  41. stadiamaps/models/highway_classification.py +52 -34
  42. stadiamaps/models/intersecting_edge.py +45 -27
  43. stadiamaps/models/isochrone_costing_model.py +8 -11
  44. stadiamaps/models/isochrone_feature.py +45 -27
  45. stadiamaps/models/isochrone_properties.py +48 -30
  46. stadiamaps/models/isochrone_request.py +54 -35
  47. stadiamaps/models/isochrone_response.py +47 -29
  48. stadiamaps/models/locate_detailed_edge.py +73 -55
  49. stadiamaps/models/locate_edge.py +56 -39
  50. stadiamaps/models/locate_edge_info.py +47 -29
  51. stadiamaps/models/locate_node.py +50 -31
  52. stadiamaps/models/locate_node_all_of.py +1 -1
  53. stadiamaps/models/locate_object.py +49 -31
  54. stadiamaps/models/maneuver_sign.py +50 -32
  55. stadiamaps/models/maneuver_sign_element.py +45 -27
  56. stadiamaps/models/map_match_costing_model.py +8 -11
  57. stadiamaps/models/map_match_request.py +74 -44
  58. stadiamaps/models/map_match_request_all_of.py +1 -1
  59. stadiamaps/models/map_match_route_response.py +57 -29
  60. stadiamaps/models/map_match_route_response_all_of.py +1 -1
  61. stadiamaps/models/map_match_trace_options.py +47 -29
  62. stadiamaps/models/map_match_waypoint.py +49 -30
  63. stadiamaps/models/map_match_waypoint_all_of.py +1 -1
  64. stadiamaps/models/matched_point.py +52 -34
  65. stadiamaps/models/matrix_costing_model.py +9 -12
  66. stadiamaps/models/matrix_distance.py +46 -28
  67. stadiamaps/models/matrix_request.py +70 -39
  68. stadiamaps/models/matrix_response.py +60 -36
  69. stadiamaps/models/motor_scooter_costing_options.py +70 -49
  70. stadiamaps/models/motor_scooter_costing_options_all_of.py +1 -1
  71. stadiamaps/models/motorcycle_costing_options.py +69 -48
  72. stadiamaps/models/motorcycle_costing_options_all_of.py +1 -1
  73. stadiamaps/models/nearest_roads_request.py +65 -34
  74. stadiamaps/models/node_id.py +42 -24
  75. stadiamaps/models/node_type.py +8 -11
  76. stadiamaps/models/optimized_route_request.py +66 -35
  77. stadiamaps/models/pedestrian_costing_options.py +59 -40
  78. stadiamaps/models/pelias_geo_json_feature.py +50 -31
  79. stadiamaps/models/pelias_geo_json_properties.py +54 -36
  80. stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
  81. stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
  82. stadiamaps/models/pelias_layer.py +8 -11
  83. stadiamaps/models/pelias_response.py +49 -30
  84. stadiamaps/models/pelias_response_geocoding.py +1 -1
  85. stadiamaps/models/pelias_source.py +8 -11
  86. stadiamaps/models/restrictions.py +44 -26
  87. stadiamaps/models/road_class.py +8 -11
  88. stadiamaps/models/route_leg.py +48 -29
  89. stadiamaps/models/route_maneuver.py +73 -55
  90. stadiamaps/models/route_request.py +76 -43
  91. stadiamaps/models/route_response.py +56 -28
  92. stadiamaps/models/route_response_alternates_inner.py +105 -0
  93. stadiamaps/models/route_response_trip.py +1 -1
  94. stadiamaps/models/route_summary.py +48 -30
  95. stadiamaps/models/route_trip.py +135 -0
  96. stadiamaps/models/routing_response_waypoint.py +49 -30
  97. stadiamaps/models/routing_response_waypoint_all_of.py +1 -1
  98. stadiamaps/models/routing_waypoint.py +60 -41
  99. stadiamaps/models/routing_waypoint_all_of.py +1 -1
  100. stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
  101. stadiamaps/models/simple_routing_waypoint.py +48 -29
  102. stadiamaps/models/simple_routing_waypoint_all_of.py +1 -1
  103. stadiamaps/models/speeds.py +49 -31
  104. stadiamaps/models/trace_attribute_filter_options.py +47 -28
  105. stadiamaps/models/trace_attribute_key.py +8 -11
  106. stadiamaps/models/trace_attributes_base_response.py +51 -32
  107. stadiamaps/models/trace_attributes_request.py +72 -42
  108. stadiamaps/models/trace_attributes_request_all_of.py +1 -1
  109. stadiamaps/models/trace_attributes_request_all_of_filters.py +2 -2
  110. stadiamaps/models/trace_attributes_response.py +54 -35
  111. stadiamaps/models/trace_attributes_response_all_of.py +1 -1
  112. stadiamaps/models/trace_edge.py +88 -70
  113. stadiamaps/models/travel_mode.py +8 -11
  114. stadiamaps/models/traversability.py +8 -11
  115. stadiamaps/models/truck_costing_options.py +72 -51
  116. stadiamaps/models/truck_costing_options_all_of.py +1 -1
  117. stadiamaps/models/tz_response.py +45 -27
  118. stadiamaps/models/valhalla_languages.py +8 -11
  119. stadiamaps/models/valhalla_long_units.py +8 -11
  120. stadiamaps/models/warning.py +42 -24
  121. stadiamaps/py.typed +0 -0
  122. stadiamaps/rest.py +127 -172
  123. {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/METADATA +4 -4
  124. stadiamaps-2.0.0.dist-info/RECORD +128 -0
  125. {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/WHEEL +1 -1
  126. stadiamaps-1.0.6.dist-info/RECORD +0 -125
  127. {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/LICENSE.txt +0 -0
  128. {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/top_level.txt +0 -0
@@ -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. # noqa: E501
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: 5.0.5
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,51 +18,69 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
-
22
- from typing import List, Union
23
- from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
24
26
 
25
27
  class GeoJSONLineString(BaseModel):
26
28
  """
27
29
  GeoJSONLineString
28
- """
29
- type: StrictStr = Field(...)
30
- coordinates: conlist(conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=2)) = Field(...)
30
+ """ # noqa: E501
31
+ type: StrictStr
32
+ coordinates: List[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=3)]]
31
33
  additional_properties: Dict[str, Any] = {}
32
- __properties = ["type", "coordinates"]
34
+ __properties: ClassVar[List[str]] = ["type", "coordinates"]
33
35
 
34
- @validator('type')
36
+ @field_validator('type')
35
37
  def type_validate_enum(cls, value):
36
38
  """Validates the enum"""
37
- if value not in ('Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon'):
39
+ if value not in set(['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon']):
38
40
  raise ValueError("must be one of enum values ('Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon')")
39
41
  return value
40
42
 
41
- class Config:
42
- """Pydantic configuration"""
43
- allow_population_by_field_name = True
44
- validate_assignment = True
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
45
49
 
46
50
  def to_str(self) -> str:
47
51
  """Returns the string representation of the model using alias"""
48
- return pprint.pformat(self.dict(by_alias=True))
52
+ return pprint.pformat(self.model_dump(by_alias=True))
49
53
 
50
54
  def to_json(self) -> str:
51
55
  """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
57
  return json.dumps(self.to_dict())
53
58
 
54
59
  @classmethod
55
- def from_json(cls, json_str: str) -> GeoJSONLineString:
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
61
  """Create an instance of GeoJSONLineString from a JSON string"""
57
62
  return cls.from_dict(json.loads(json_str))
58
63
 
59
- def to_dict(self):
60
- """Returns the dictionary representation of the model using alias"""
61
- _dict = self.dict(by_alias=True,
62
- exclude={
63
- "additional_properties"
64
- },
65
- exclude_none=True)
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ * Fields in `self.additional_properties` are added to the output dict.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ "additional_properties",
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
66
84
  # puts key-value pairs in additional_properties in the top level
67
85
  if self.additional_properties is not None:
68
86
  for _key, _value in self.additional_properties.items():
@@ -71,15 +89,15 @@ class GeoJSONLineString(BaseModel):
71
89
  return _dict
72
90
 
73
91
  @classmethod
74
- def from_dict(cls, obj: dict) -> GeoJSONLineString:
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
93
  """Create an instance of GeoJSONLineString from a dict"""
76
94
  if obj is None:
77
95
  return None
78
96
 
79
97
  if not isinstance(obj, dict):
80
- return GeoJSONLineString.parse_obj(obj)
98
+ return cls.model_validate(obj)
81
99
 
82
- _obj = GeoJSONLineString.parse_obj({
100
+ _obj = cls.model_validate({
83
101
  "type": obj.get("type"),
84
102
  "coordinates": obj.get("coordinates")
85
103
  })
@@ -90,3 +108,4 @@ class GeoJSONLineString(BaseModel):
90
108
 
91
109
  return _obj
92
110
 
111
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications. # noqa: E501
7
7
 
8
- The version of the OpenAPI document: 5.0.5
8
+ The version of the OpenAPI document: 5.0.6
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -26,7 +26,7 @@ class GeoJSONLineStringAllOf(BaseModel):
26
26
  """
27
27
  GeoJSONLineStringAllOf
28
28
  """
29
- coordinates: conlist(conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=2)) = Field(...)
29
+ coordinates: conlist(conlist(Union[StrictFloat, StrictInt], max_length=3, min_length=2)) = Field(...)
30
30
  additional_properties: Dict[str, Any] = {}
31
31
  __properties = ["coordinates"]
32
32
 
@@ -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. # noqa: E501
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: 5.0.5
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,51 +18,69 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
-
22
- from typing import List, Union
23
- from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
24
26
 
25
27
  class GeoJSONPoint(BaseModel):
26
28
  """
27
29
  GeoJSONPoint
28
- """
29
- type: StrictStr = Field(...)
30
- coordinates: conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=2) = Field(...)
30
+ """ # noqa: E501
31
+ type: StrictStr
32
+ coordinates: Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=3)]
31
33
  additional_properties: Dict[str, Any] = {}
32
- __properties = ["type", "coordinates"]
34
+ __properties: ClassVar[List[str]] = ["type", "coordinates"]
33
35
 
34
- @validator('type')
36
+ @field_validator('type')
35
37
  def type_validate_enum(cls, value):
36
38
  """Validates the enum"""
37
- if value not in ('Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon'):
39
+ if value not in set(['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon']):
38
40
  raise ValueError("must be one of enum values ('Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon')")
39
41
  return value
40
42
 
41
- class Config:
42
- """Pydantic configuration"""
43
- allow_population_by_field_name = True
44
- validate_assignment = True
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
45
49
 
46
50
  def to_str(self) -> str:
47
51
  """Returns the string representation of the model using alias"""
48
- return pprint.pformat(self.dict(by_alias=True))
52
+ return pprint.pformat(self.model_dump(by_alias=True))
49
53
 
50
54
  def to_json(self) -> str:
51
55
  """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
57
  return json.dumps(self.to_dict())
53
58
 
54
59
  @classmethod
55
- def from_json(cls, json_str: str) -> GeoJSONPoint:
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
61
  """Create an instance of GeoJSONPoint from a JSON string"""
57
62
  return cls.from_dict(json.loads(json_str))
58
63
 
59
- def to_dict(self):
60
- """Returns the dictionary representation of the model using alias"""
61
- _dict = self.dict(by_alias=True,
62
- exclude={
63
- "additional_properties"
64
- },
65
- exclude_none=True)
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ * Fields in `self.additional_properties` are added to the output dict.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ "additional_properties",
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
66
84
  # puts key-value pairs in additional_properties in the top level
67
85
  if self.additional_properties is not None:
68
86
  for _key, _value in self.additional_properties.items():
@@ -71,15 +89,15 @@ class GeoJSONPoint(BaseModel):
71
89
  return _dict
72
90
 
73
91
  @classmethod
74
- def from_dict(cls, obj: dict) -> GeoJSONPoint:
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
93
  """Create an instance of GeoJSONPoint from a dict"""
76
94
  if obj is None:
77
95
  return None
78
96
 
79
97
  if not isinstance(obj, dict):
80
- return GeoJSONPoint.parse_obj(obj)
98
+ return cls.model_validate(obj)
81
99
 
82
- _obj = GeoJSONPoint.parse_obj({
100
+ _obj = cls.model_validate({
83
101
  "type": obj.get("type"),
84
102
  "coordinates": obj.get("coordinates")
85
103
  })
@@ -90,3 +108,4 @@ class GeoJSONPoint(BaseModel):
90
108
 
91
109
  return _obj
92
110
 
111
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications. # noqa: E501
7
7
 
8
- The version of the OpenAPI document: 5.0.5
8
+ The version of the OpenAPI document: 5.0.6
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -26,7 +26,7 @@ class GeoJSONPointAllOf(BaseModel):
26
26
  """
27
27
  GeoJSONPointAllOf
28
28
  """
29
- coordinates: conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=2) = Field(...)
29
+ coordinates: conlist(Union[StrictFloat, StrictInt], max_length=3, min_length=2) = Field(...)
30
30
  additional_properties: Dict[str, Any] = {}
31
31
  __properties = ["coordinates"]
32
32
 
@@ -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. # noqa: E501
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: 5.0.5
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,51 +18,69 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
-
22
- from typing import List, Union
23
- from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
24
26
 
25
27
  class GeoJSONPolygon(BaseModel):
26
28
  """
27
29
  GeoJSONPolygon
28
- """
29
- type: StrictStr = Field(...)
30
- coordinates: conlist(conlist(conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=2))) = Field(...)
30
+ """ # noqa: E501
31
+ type: StrictStr
32
+ coordinates: List[List[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=3)]]]
31
33
  additional_properties: Dict[str, Any] = {}
32
- __properties = ["type", "coordinates"]
34
+ __properties: ClassVar[List[str]] = ["type", "coordinates"]
33
35
 
34
- @validator('type')
36
+ @field_validator('type')
35
37
  def type_validate_enum(cls, value):
36
38
  """Validates the enum"""
37
- if value not in ('Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon'):
39
+ if value not in set(['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon']):
38
40
  raise ValueError("must be one of enum values ('Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon')")
39
41
  return value
40
42
 
41
- class Config:
42
- """Pydantic configuration"""
43
- allow_population_by_field_name = True
44
- validate_assignment = True
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
45
49
 
46
50
  def to_str(self) -> str:
47
51
  """Returns the string representation of the model using alias"""
48
- return pprint.pformat(self.dict(by_alias=True))
52
+ return pprint.pformat(self.model_dump(by_alias=True))
49
53
 
50
54
  def to_json(self) -> str:
51
55
  """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
57
  return json.dumps(self.to_dict())
53
58
 
54
59
  @classmethod
55
- def from_json(cls, json_str: str) -> GeoJSONPolygon:
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
61
  """Create an instance of GeoJSONPolygon from a JSON string"""
57
62
  return cls.from_dict(json.loads(json_str))
58
63
 
59
- def to_dict(self):
60
- """Returns the dictionary representation of the model using alias"""
61
- _dict = self.dict(by_alias=True,
62
- exclude={
63
- "additional_properties"
64
- },
65
- exclude_none=True)
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ * Fields in `self.additional_properties` are added to the output dict.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ "additional_properties",
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
66
84
  # puts key-value pairs in additional_properties in the top level
67
85
  if self.additional_properties is not None:
68
86
  for _key, _value in self.additional_properties.items():
@@ -71,15 +89,15 @@ class GeoJSONPolygon(BaseModel):
71
89
  return _dict
72
90
 
73
91
  @classmethod
74
- def from_dict(cls, obj: dict) -> GeoJSONPolygon:
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
93
  """Create an instance of GeoJSONPolygon from a dict"""
76
94
  if obj is None:
77
95
  return None
78
96
 
79
97
  if not isinstance(obj, dict):
80
- return GeoJSONPolygon.parse_obj(obj)
98
+ return cls.model_validate(obj)
81
99
 
82
- _obj = GeoJSONPolygon.parse_obj({
100
+ _obj = cls.model_validate({
83
101
  "type": obj.get("type"),
84
102
  "coordinates": obj.get("coordinates")
85
103
  })
@@ -90,3 +108,4 @@ class GeoJSONPolygon(BaseModel):
90
108
 
91
109
  return _obj
92
110
 
111
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications. # noqa: E501
7
7
 
8
- The version of the OpenAPI document: 5.0.5
8
+ The version of the OpenAPI document: 5.0.6
9
9
  Contact: support@stadiamaps.com
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
@@ -26,7 +26,7 @@ class GeoJSONPolygonAllOf(BaseModel):
26
26
  """
27
27
  GeoJSONPolygonAllOf
28
28
  """
29
- coordinates: conlist(conlist(conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=2))) = Field(...)
29
+ coordinates: conlist(conlist(conlist(Union[StrictFloat, StrictInt], max_length=3, min_length=2))) = Field(...)
30
30
  additional_properties: Dict[str, Any] = {}
31
31
  __properties = ["coordinates"]
32
32
 
@@ -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. # noqa: E501
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: 5.0.5
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 Any, Dict, List, Optional
23
- from pydantic import BaseModel, Field, StrictStr, conlist
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 GeocodingObject(BaseModel):
26
27
  """
27
28
  GeocodingObject
28
- """
29
- attribution: Optional[StrictStr] = Field(None, description="A URL containing attribution information. If you are not using Stadia Maps and our standard attribution already for your basemaps, you must include this attribution link somewhere in your website/app.")
30
- query: Optional[Dict[str, Any]] = Field(None, description="Technical details of the query. This is most useful for debugging during development. See the full example for the list of properties; these should be self-explanatory, so we don't enumerate them in the spec.")
31
- warnings: Optional[conlist(StrictStr)] = Field(None, description="An array of non-critical warnings. This is normally for informational/debugging purposes and not a serious problem.")
32
- errors: Optional[conlist(StrictStr)] = Field(None, description="An array of more serious errors (for example, omitting a required parameter). Don’t ignore these.")
29
+ """ # noqa: E501
30
+ attribution: Optional[StrictStr] = Field(default=None, description="A URL containing attribution information. If you are not using Stadia Maps and our standard attribution already for your basemaps, you must include this attribution link somewhere in your website/app.")
31
+ query: Optional[Dict[str, Any]] = Field(default=None, description="Technical details of the query. This is most useful for debugging during development. See the full example for the list of properties; these should be self-explanatory, so we don't enumerate them in the spec.")
32
+ warnings: Optional[List[StrictStr]] = Field(default=None, description="An array of non-critical warnings. This is normally for informational/debugging purposes and not a serious problem.")
33
+ errors: Optional[List[StrictStr]] = Field(default=None, description="An array of more serious errors (for example, omitting a required parameter). Don’t ignore these.")
33
34
  additional_properties: Dict[str, Any] = {}
34
- __properties = ["attribution", "query", "warnings", "errors"]
35
+ __properties: ClassVar[List[str]] = ["attribution", "query", "warnings", "errors"]
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.dict(by_alias=True))
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) -> GeocodingObject:
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
55
  """Create an instance of GeocodingObject from a JSON string"""
52
56
  return cls.from_dict(json.loads(json_str))
53
57
 
54
- def to_dict(self):
55
- """Returns the dictionary representation of the model using alias"""
56
- _dict = self.dict(by_alias=True,
57
- exclude={
58
- "additional_properties"
59
- },
60
- exclude_none=True)
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 GeocodingObject(BaseModel):
66
83
  return _dict
67
84
 
68
85
  @classmethod
69
- def from_dict(cls, obj: dict) -> GeocodingObject:
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
70
87
  """Create an instance of GeocodingObject from a dict"""
71
88
  if obj is None:
72
89
  return None
73
90
 
74
91
  if not isinstance(obj, dict):
75
- return GeocodingObject.parse_obj(obj)
92
+ return cls.model_validate(obj)
76
93
 
77
- _obj = GeocodingObject.parse_obj({
94
+ _obj = cls.model_validate({
78
95
  "attribution": obj.get("attribution"),
79
96
  "query": obj.get("query"),
80
97
  "warnings": obj.get("warnings"),
@@ -87,3 +104,4 @@ class GeocodingObject(BaseModel):
87
104
 
88
105
  return _obj
89
106
 
107
+