stadiamaps 5.0.0__py3-none-any.whl → 6.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stadiamaps/__init__.py +23 -5
- stadiamaps/api/geocoding_api.py +849 -38
- stadiamaps/api/geospatial_api.py +1 -1
- stadiamaps/api/routing_api.py +1 -1
- stadiamaps/api_client.py +3 -3
- stadiamaps/configuration.py +5 -5
- stadiamaps/exceptions.py +18 -1
- stadiamaps/models/__init__.py +22 -4
- stadiamaps/models/access.py +1 -1
- stadiamaps/models/addendum_v2.py +143 -0
- stadiamaps/models/address_components_v2.py +134 -0
- stadiamaps/models/admin_region.py +1 -1
- stadiamaps/models/administrative.py +1 -1
- stadiamaps/models/annotation_filters.py +1 -1
- stadiamaps/models/auto_costing_options.py +1 -1
- stadiamaps/models/base_costing_options.py +1 -1
- stadiamaps/models/base_trace_request.py +1 -1
- stadiamaps/models/bicycle_costing_options.py +1 -1
- stadiamaps/models/bike_network.py +1 -1
- stadiamaps/models/bulk_request.py +1 -1
- stadiamaps/models/bulk_request_query.py +1 -1
- stadiamaps/models/bulk_search_response.py +1 -1
- stadiamaps/models/context.py +119 -0
- stadiamaps/models/contour.py +1 -1
- stadiamaps/models/coordinate.py +1 -1
- stadiamaps/models/costing_model.py +1 -1
- stadiamaps/models/costing_options.py +1 -1
- stadiamaps/models/directions_options.py +1 -1
- stadiamaps/models/distance_unit.py +1 -1
- stadiamaps/models/edge_sign.py +1 -1
- stadiamaps/models/edge_use.py +1 -1
- stadiamaps/models/end_node.py +1 -1
- stadiamaps/models/extended_directions_options.py +1 -1
- stadiamaps/models/feature_properties_v2.py +126 -0
- stadiamaps/models/feature_properties_v2_properties.py +184 -0
- stadiamaps/models/foursquare_addendum.py +113 -0
- stadiamaps/models/geo_attributes.py +1 -1
- stadiamaps/models/geo_json_geometry_base.py +1 -1
- stadiamaps/models/geo_json_point.py +1 -1
- stadiamaps/models/geocode_response.py +1 -1
- stadiamaps/models/geocode_response_envelope_properties_v2.py +125 -0
- stadiamaps/models/geocoding_geo_json_feature.py +1 -1
- stadiamaps/models/geocoding_geo_json_properties.py +8 -6
- stadiamaps/models/geocoding_geo_json_properties_addendum.py +1 -1
- stadiamaps/models/geocoding_geo_json_properties_addendum_osm.py +1 -1
- stadiamaps/models/geocoding_layer.py +1 -1
- stadiamaps/models/geocoding_meta.py +108 -0
- stadiamaps/models/geocoding_object.py +1 -1
- stadiamaps/models/geocoding_source.py +1 -1
- stadiamaps/models/geonames_addendum.py +101 -0
- stadiamaps/models/height_request.py +1 -1
- stadiamaps/models/height_response.py +1 -1
- stadiamaps/models/highway_classification.py +1 -1
- stadiamaps/models/intersecting_edge.py +1 -1
- stadiamaps/models/isochrone_costing_model.py +1 -1
- stadiamaps/models/isochrone_feature.py +1 -1
- stadiamaps/models/isochrone_properties.py +1 -1
- stadiamaps/models/isochrone_request.py +1 -1
- stadiamaps/models/isochrone_response.py +1 -1
- stadiamaps/models/layer_id.py +57 -0
- stadiamaps/models/locate_detailed_edge.py +1 -1
- stadiamaps/models/locate_edge.py +1 -1
- stadiamaps/models/locate_edge_info.py +1 -1
- stadiamaps/models/locate_node.py +1 -1
- stadiamaps/models/locate_object.py +1 -1
- stadiamaps/models/low_speed_vehicle_costing_options.py +1 -1
- stadiamaps/models/maneuver_sign.py +1 -1
- stadiamaps/models/maneuver_sign_element.py +1 -1
- stadiamaps/models/map_match_costing_model.py +1 -1
- stadiamaps/models/map_match_request.py +1 -1
- stadiamaps/models/map_match_route_response.py +1 -1
- stadiamaps/models/map_match_trace_options.py +1 -1
- stadiamaps/models/map_match_waypoint.py +3 -3
- stadiamaps/models/match_type.py +39 -0
- stadiamaps/models/matched_point.py +1 -1
- stadiamaps/models/matrix_costing_model.py +1 -1
- stadiamaps/models/matrix_distance.py +1 -1
- stadiamaps/models/matrix_request.py +1 -1
- stadiamaps/models/matrix_response.py +1 -1
- stadiamaps/models/matrix_waypoint.py +1 -1
- stadiamaps/models/motor_scooter_costing_options.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +1 -1
- stadiamaps/models/nearest_roads_request.py +1 -1
- stadiamaps/models/node_id.py +1 -1
- stadiamaps/models/node_type.py +1 -1
- stadiamaps/models/open_street_map_addendum.py +162 -0
- stadiamaps/models/optimized_route_request.py +1 -1
- stadiamaps/models/osrm_admin.py +1 -1
- stadiamaps/models/osrm_annotation.py +1 -1
- stadiamaps/models/osrm_banner_component.py +1 -1
- stadiamaps/models/osrm_banner_content.py +1 -1
- stadiamaps/models/osrm_banner_instruction.py +1 -1
- stadiamaps/models/osrm_base_api_response.py +1 -1
- stadiamaps/models/osrm_guidance_modifier.py +1 -1
- stadiamaps/models/osrm_intersection.py +1 -1
- stadiamaps/models/osrm_lane.py +1 -1
- stadiamaps/models/osrm_route.py +1 -1
- stadiamaps/models/osrm_route_leg.py +1 -1
- stadiamaps/models/osrm_route_response.py +1 -1
- stadiamaps/models/osrm_route_step.py +1 -1
- stadiamaps/models/osrm_speed_limit.py +1 -1
- stadiamaps/models/osrm_step_maneuver.py +1 -1
- stadiamaps/models/osrm_via_waypoint.py +1 -1
- stadiamaps/models/osrm_voice_instruction.py +1 -1
- stadiamaps/models/osrm_waypoint.py +1 -1
- stadiamaps/models/pedestrian_costing_options.py +8 -5
- stadiamaps/models/pedestrian_type.py +39 -0
- stadiamaps/models/point.py +104 -0
- stadiamaps/models/precision.py +38 -0
- stadiamaps/models/properties_v2.py +184 -0
- stadiamaps/models/restrictions.py +11 -11
- stadiamaps/models/road_class.py +1 -1
- stadiamaps/models/route200_response.py +1 -1
- stadiamaps/models/route_leg.py +1 -1
- stadiamaps/models/route_maneuver.py +1 -1
- stadiamaps/models/route_request.py +1 -1
- stadiamaps/models/route_response.py +1 -1
- stadiamaps/models/route_response_alternates_inner.py +1 -1
- stadiamaps/models/route_summary.py +1 -1
- stadiamaps/models/route_trip.py +1 -1
- stadiamaps/models/routing_languages.py +1 -1
- stadiamaps/models/routing_long_units.py +1 -1
- stadiamaps/models/routing_response_waypoint.py +3 -3
- stadiamaps/models/routing_waypoint.py +3 -3
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +1 -1
- stadiamaps/models/search_query.py +2 -2
- stadiamaps/models/search_structured_query.py +3 -3
- stadiamaps/models/simple_routing_waypoint.py +3 -3
- stadiamaps/models/source_attribution.py +110 -0
- stadiamaps/models/source_id.py +41 -0
- stadiamaps/models/speeds.py +1 -1
- stadiamaps/models/trace_attribute_filter_options.py +1 -1
- stadiamaps/models/trace_attribute_key.py +1 -1
- stadiamaps/models/trace_attributes_base_response.py +1 -1
- stadiamaps/models/trace_attributes_request.py +1 -1
- stadiamaps/models/trace_attributes_response.py +1 -6
- stadiamaps/models/trace_edge.py +2 -7
- stadiamaps/models/travel_mode.py +1 -1
- stadiamaps/models/traversability.py +1 -1
- stadiamaps/models/truck_costing_options.py +1 -1
- stadiamaps/models/tz_response.py +1 -1
- stadiamaps/models/warning.py +1 -1
- stadiamaps/models/whos_on_first_concordances.py +246 -0
- stadiamaps/models/wof_context.py +210 -0
- stadiamaps/models/wof_context_component.py +110 -0
- stadiamaps/rest.py +1 -1
- stadiamaps-6.0.0.dist-info/METADATA +117 -0
- stadiamaps-6.0.0.dist-info/RECORD +183 -0
- {stadiamaps-5.0.0.dist-info → stadiamaps-6.0.0.dist-info}/WHEEL +1 -1
- {stadiamaps-5.0.0.dist-info → stadiamaps-6.0.0.dist-info}/top_level.txt +1 -0
- test/integration/__init__.py +0 -0
- test/integration/test_eu_endpoint.py +21 -0
- test/integration/test_gecoding.py +112 -0
- test/integration/test_geospatial.py +43 -0
- test/integration/test_routing.py +282 -0
- stadiamaps-5.0.0.dist-info/METADATA +0 -87
- stadiamaps-5.0.0.dist-info/RECORD +0 -157
- {stadiamaps-5.0.0.dist-info → stadiamaps-6.0.0.dist-info/licenses}/LICENSE.txt +0 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from stadiamaps.models.wof_context import WofContext
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class Context(BaseModel):
|
28
|
+
"""
|
29
|
+
The geographic context for a feature. Note that while data sources and country codes are listed, this does not *necessarily* mean that the view is a specific hierarchy endorsed by that source. We generally attempt to present the same view as OpenStreetMap. Contact us if your use case requires a specific political view of the world.
|
30
|
+
""" # noqa: E501
|
31
|
+
iso_3166_a2: Optional[StrictStr] = Field(default=None, description="The ISO 3166-1 alpha-2 country code in which the feature is located.")
|
32
|
+
iso_3166_a3: Optional[StrictStr] = Field(default=None, description="The ISO 3166-1 alpha-3 country code in which the feature is located.")
|
33
|
+
whosonfirst: WofContext = Field(description="The geographic context, with administrative hierarchy modeled using the Who's on First taxonomy.")
|
34
|
+
additional_properties: Dict[str, Any] = {}
|
35
|
+
__properties: ClassVar[List[str]] = ["iso_3166_a2", "iso_3166_a3", "whosonfirst"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
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
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of Context from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
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
|
+
)
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of whosonfirst
|
79
|
+
if self.whosonfirst:
|
80
|
+
_dict['whosonfirst'] = self.whosonfirst.to_dict()
|
81
|
+
# puts key-value pairs in additional_properties in the top level
|
82
|
+
if self.additional_properties is not None:
|
83
|
+
for _key, _value in self.additional_properties.items():
|
84
|
+
_dict[_key] = _value
|
85
|
+
|
86
|
+
# set to None if iso_3166_a2 (nullable) is None
|
87
|
+
# and model_fields_set contains the field
|
88
|
+
if self.iso_3166_a2 is None and "iso_3166_a2" in self.model_fields_set:
|
89
|
+
_dict['iso_3166_a2'] = None
|
90
|
+
|
91
|
+
# set to None if iso_3166_a3 (nullable) is None
|
92
|
+
# and model_fields_set contains the field
|
93
|
+
if self.iso_3166_a3 is None and "iso_3166_a3" in self.model_fields_set:
|
94
|
+
_dict['iso_3166_a3'] = None
|
95
|
+
|
96
|
+
return _dict
|
97
|
+
|
98
|
+
@classmethod
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
100
|
+
"""Create an instance of Context from a dict"""
|
101
|
+
if obj is None:
|
102
|
+
return None
|
103
|
+
|
104
|
+
if not isinstance(obj, dict):
|
105
|
+
return cls.model_validate(obj)
|
106
|
+
|
107
|
+
_obj = cls.model_validate({
|
108
|
+
"iso_3166_a2": obj.get("iso_3166_a2"),
|
109
|
+
"iso_3166_a3": obj.get("iso_3166_a3"),
|
110
|
+
"whosonfirst": WofContext.from_dict(obj["whosonfirst"]) if obj.get("whosonfirst") is not None else None
|
111
|
+
})
|
112
|
+
# store additional fields in additional_properties
|
113
|
+
for _key in obj.keys():
|
114
|
+
if _key not in cls.__properties:
|
115
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
116
|
+
|
117
|
+
return _obj
|
118
|
+
|
119
|
+
|
stadiamaps/models/contour.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/coordinate.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/edge_sign.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/edge_use.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
stadiamaps/models/end_node.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from stadiamaps.models.feature_properties_v2_properties import FeaturePropertiesV2Properties
|
25
|
+
from stadiamaps.models.point import Point
|
26
|
+
from typing import Optional, Set
|
27
|
+
from typing_extensions import Self
|
28
|
+
|
29
|
+
class FeaturePropertiesV2(BaseModel):
|
30
|
+
"""
|
31
|
+
FeaturePropertiesV2
|
32
|
+
""" # noqa: E501
|
33
|
+
bbox: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=4, max_length=4)]] = None
|
34
|
+
geometry: Optional[Point] = None
|
35
|
+
properties: FeaturePropertiesV2Properties
|
36
|
+
type: Optional[StrictStr] = None
|
37
|
+
additional_properties: Dict[str, Any] = {}
|
38
|
+
__properties: ClassVar[List[str]] = ["bbox", "geometry", "properties", "type"]
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
populate_by_name=True,
|
42
|
+
validate_assignment=True,
|
43
|
+
protected_namespaces=(),
|
44
|
+
)
|
45
|
+
|
46
|
+
|
47
|
+
def to_str(self) -> str:
|
48
|
+
"""Returns the string representation of the model using alias"""
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
+
|
51
|
+
def to_json(self) -> str:
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
54
|
+
return json.dumps(self.to_dict())
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
58
|
+
"""Create an instance of FeaturePropertiesV2 from a JSON string"""
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
60
|
+
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
63
|
+
|
64
|
+
This has the following differences from calling pydantic's
|
65
|
+
`self.model_dump(by_alias=True)`:
|
66
|
+
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
68
|
+
were set at model initialization. Other fields with value `None`
|
69
|
+
are ignored.
|
70
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
71
|
+
"""
|
72
|
+
excluded_fields: Set[str] = set([
|
73
|
+
"additional_properties",
|
74
|
+
])
|
75
|
+
|
76
|
+
_dict = self.model_dump(
|
77
|
+
by_alias=True,
|
78
|
+
exclude=excluded_fields,
|
79
|
+
exclude_none=True,
|
80
|
+
)
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of geometry
|
82
|
+
if self.geometry:
|
83
|
+
_dict['geometry'] = self.geometry.to_dict()
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of properties
|
85
|
+
if self.properties:
|
86
|
+
_dict['properties'] = self.properties.to_dict()
|
87
|
+
# puts key-value pairs in additional_properties in the top level
|
88
|
+
if self.additional_properties is not None:
|
89
|
+
for _key, _value in self.additional_properties.items():
|
90
|
+
_dict[_key] = _value
|
91
|
+
|
92
|
+
# set to None if bbox (nullable) is None
|
93
|
+
# and model_fields_set contains the field
|
94
|
+
if self.bbox is None and "bbox" in self.model_fields_set:
|
95
|
+
_dict['bbox'] = None
|
96
|
+
|
97
|
+
# set to None if geometry (nullable) is None
|
98
|
+
# and model_fields_set contains the field
|
99
|
+
if self.geometry is None and "geometry" in self.model_fields_set:
|
100
|
+
_dict['geometry'] = None
|
101
|
+
|
102
|
+
return _dict
|
103
|
+
|
104
|
+
@classmethod
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
106
|
+
"""Create an instance of FeaturePropertiesV2 from a dict"""
|
107
|
+
if obj is None:
|
108
|
+
return None
|
109
|
+
|
110
|
+
if not isinstance(obj, dict):
|
111
|
+
return cls.model_validate(obj)
|
112
|
+
|
113
|
+
_obj = cls.model_validate({
|
114
|
+
"bbox": obj.get("bbox"),
|
115
|
+
"geometry": Point.from_dict(obj["geometry"]) if obj.get("geometry") is not None else None,
|
116
|
+
"properties": FeaturePropertiesV2Properties.from_dict(obj["properties"]) if obj.get("properties") is not None else None,
|
117
|
+
"type": obj.get("type")
|
118
|
+
})
|
119
|
+
# store additional fields in additional_properties
|
120
|
+
for _key in obj.keys():
|
121
|
+
if _key not in cls.__properties:
|
122
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
123
|
+
|
124
|
+
return _obj
|
125
|
+
|
126
|
+
|
@@ -0,0 +1,184 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from stadiamaps.models.addendum_v2 import AddendumV2
|
24
|
+
from stadiamaps.models.address_components_v2 import AddressComponentsV2
|
25
|
+
from stadiamaps.models.context import Context
|
26
|
+
from stadiamaps.models.match_type import MatchType
|
27
|
+
from stadiamaps.models.precision import Precision
|
28
|
+
from stadiamaps.models.source_attribution import SourceAttribution
|
29
|
+
from typing import Optional, Set
|
30
|
+
from typing_extensions import Self
|
31
|
+
|
32
|
+
class FeaturePropertiesV2Properties(BaseModel):
|
33
|
+
"""
|
34
|
+
The GeoJSON properties object.
|
35
|
+
""" # noqa: E501
|
36
|
+
addendum: Optional[AddendumV2] = None
|
37
|
+
address_components: Optional[AddressComponentsV2] = None
|
38
|
+
coarse_location: Optional[StrictStr] = Field(default=None, description="The coarse-grained location of the place (e.g. Seoul, South Korea). In search experiences, this is typically the second line of a result cell.")
|
39
|
+
confidence: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The level of confidence (0.0 - 1.0) that the result is what you actually searched for. This is not necessarily the same as relevance (results are returned sorted by relevance already), but rather how closely the explicit or inferred components match the result. This is only present for forward geocoding responses (not autocomplete or place details).")
|
40
|
+
context: Optional[Context] = None
|
41
|
+
distance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The distance from the search focus point, in kilometers.")
|
42
|
+
formatted_address_line: Optional[StrictStr] = Field(default=None, description="The address formatted as a single line, following local postal conventions for ordering and separators.")
|
43
|
+
formatted_address_lines: Optional[List[StrictStr]] = Field(default=None, description="Address components split up into lines, following local postal conventions for ordering and separators.")
|
44
|
+
gid: StrictStr = Field(description="The globally unique identifier for this result. You can use this to uniquely identify a place, and to get the full details from the place details endpoint. NOTE: While GIDs are unique, they may not necessarily be stable in all datasets.")
|
45
|
+
layer: StrictStr = Field(description="The data layer containing the place (e.g. \"address\" or \"poi\").")
|
46
|
+
match_type: Optional[MatchType] = Field(default=None, description="The type of match (forward geocoding endpoints only).")
|
47
|
+
name: StrictStr = Field(description="The best name for the place, accounting for request language preferences. When building an autocomplete search experience, this is the primary display string.")
|
48
|
+
precision: Precision
|
49
|
+
sources: Optional[List[SourceAttribution]] = Field(default=None, description="A list of sources from which the result is derived.")
|
50
|
+
additional_properties: Dict[str, Any] = {}
|
51
|
+
__properties: ClassVar[List[str]] = ["addendum", "address_components", "coarse_location", "confidence", "context", "distance", "formatted_address_line", "formatted_address_lines", "gid", "layer", "match_type", "name", "precision", "sources"]
|
52
|
+
|
53
|
+
model_config = ConfigDict(
|
54
|
+
populate_by_name=True,
|
55
|
+
validate_assignment=True,
|
56
|
+
protected_namespaces=(),
|
57
|
+
)
|
58
|
+
|
59
|
+
|
60
|
+
def to_str(self) -> str:
|
61
|
+
"""Returns the string representation of the model using alias"""
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
63
|
+
|
64
|
+
def to_json(self) -> str:
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
66
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
67
|
+
return json.dumps(self.to_dict())
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
71
|
+
"""Create an instance of FeaturePropertiesV2Properties from a JSON string"""
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
73
|
+
|
74
|
+
def to_dict(self) -> Dict[str, Any]:
|
75
|
+
"""Return the dictionary representation of the model using alias.
|
76
|
+
|
77
|
+
This has the following differences from calling pydantic's
|
78
|
+
`self.model_dump(by_alias=True)`:
|
79
|
+
|
80
|
+
* `None` is only added to the output dict for nullable fields that
|
81
|
+
were set at model initialization. Other fields with value `None`
|
82
|
+
are ignored.
|
83
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
84
|
+
"""
|
85
|
+
excluded_fields: Set[str] = set([
|
86
|
+
"additional_properties",
|
87
|
+
])
|
88
|
+
|
89
|
+
_dict = self.model_dump(
|
90
|
+
by_alias=True,
|
91
|
+
exclude=excluded_fields,
|
92
|
+
exclude_none=True,
|
93
|
+
)
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of addendum
|
95
|
+
if self.addendum:
|
96
|
+
_dict['addendum'] = self.addendum.to_dict()
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of address_components
|
98
|
+
if self.address_components:
|
99
|
+
_dict['address_components'] = self.address_components.to_dict()
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of context
|
101
|
+
if self.context:
|
102
|
+
_dict['context'] = self.context.to_dict()
|
103
|
+
# override the default output from pydantic by calling `to_dict()` of each item in sources (list)
|
104
|
+
_items = []
|
105
|
+
if self.sources:
|
106
|
+
for _item_sources in self.sources:
|
107
|
+
if _item_sources:
|
108
|
+
_items.append(_item_sources.to_dict())
|
109
|
+
_dict['sources'] = _items
|
110
|
+
# puts key-value pairs in additional_properties in the top level
|
111
|
+
if self.additional_properties is not None:
|
112
|
+
for _key, _value in self.additional_properties.items():
|
113
|
+
_dict[_key] = _value
|
114
|
+
|
115
|
+
# set to None if addendum (nullable) is None
|
116
|
+
# and model_fields_set contains the field
|
117
|
+
if self.addendum is None and "addendum" in self.model_fields_set:
|
118
|
+
_dict['addendum'] = None
|
119
|
+
|
120
|
+
# set to None if address_components (nullable) is None
|
121
|
+
# and model_fields_set contains the field
|
122
|
+
if self.address_components is None and "address_components" in self.model_fields_set:
|
123
|
+
_dict['address_components'] = None
|
124
|
+
|
125
|
+
# set to None if coarse_location (nullable) is None
|
126
|
+
# and model_fields_set contains the field
|
127
|
+
if self.coarse_location is None and "coarse_location" in self.model_fields_set:
|
128
|
+
_dict['coarse_location'] = None
|
129
|
+
|
130
|
+
# set to None if confidence (nullable) is None
|
131
|
+
# and model_fields_set contains the field
|
132
|
+
if self.confidence is None and "confidence" in self.model_fields_set:
|
133
|
+
_dict['confidence'] = None
|
134
|
+
|
135
|
+
# set to None if context (nullable) is None
|
136
|
+
# and model_fields_set contains the field
|
137
|
+
if self.context is None and "context" in self.model_fields_set:
|
138
|
+
_dict['context'] = None
|
139
|
+
|
140
|
+
# set to None if distance (nullable) is None
|
141
|
+
# and model_fields_set contains the field
|
142
|
+
if self.distance is None and "distance" in self.model_fields_set:
|
143
|
+
_dict['distance'] = None
|
144
|
+
|
145
|
+
# set to None if match_type (nullable) is None
|
146
|
+
# and model_fields_set contains the field
|
147
|
+
if self.match_type is None and "match_type" in self.model_fields_set:
|
148
|
+
_dict['match_type'] = None
|
149
|
+
|
150
|
+
return _dict
|
151
|
+
|
152
|
+
@classmethod
|
153
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
154
|
+
"""Create an instance of FeaturePropertiesV2Properties from a dict"""
|
155
|
+
if obj is None:
|
156
|
+
return None
|
157
|
+
|
158
|
+
if not isinstance(obj, dict):
|
159
|
+
return cls.model_validate(obj)
|
160
|
+
|
161
|
+
_obj = cls.model_validate({
|
162
|
+
"addendum": AddendumV2.from_dict(obj["addendum"]) if obj.get("addendum") is not None else None,
|
163
|
+
"address_components": AddressComponentsV2.from_dict(obj["address_components"]) if obj.get("address_components") is not None else None,
|
164
|
+
"coarse_location": obj.get("coarse_location"),
|
165
|
+
"confidence": obj.get("confidence"),
|
166
|
+
"context": Context.from_dict(obj["context"]) if obj.get("context") is not None else None,
|
167
|
+
"distance": obj.get("distance"),
|
168
|
+
"formatted_address_line": obj.get("formatted_address_line"),
|
169
|
+
"formatted_address_lines": obj.get("formatted_address_lines"),
|
170
|
+
"gid": obj.get("gid"),
|
171
|
+
"layer": obj.get("layer"),
|
172
|
+
"match_type": obj.get("match_type"),
|
173
|
+
"name": obj.get("name"),
|
174
|
+
"precision": obj.get("precision"),
|
175
|
+
"sources": [SourceAttribution.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None
|
176
|
+
})
|
177
|
+
# store additional fields in additional_properties
|
178
|
+
for _key in obj.keys():
|
179
|
+
if _key not in cls.__properties:
|
180
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
181
|
+
|
182
|
+
return _obj
|
183
|
+
|
184
|
+
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class FoursquareAddendum(BaseModel):
|
27
|
+
"""
|
28
|
+
FoursquareAddendum
|
29
|
+
""" # noqa: E501
|
30
|
+
tel: Optional[StrictStr] = None
|
31
|
+
website: Optional[StrictStr] = None
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
33
|
+
__properties: ClassVar[List[str]] = ["tel", "website"]
|
34
|
+
|
35
|
+
model_config = ConfigDict(
|
36
|
+
populate_by_name=True,
|
37
|
+
validate_assignment=True,
|
38
|
+
protected_namespaces=(),
|
39
|
+
)
|
40
|
+
|
41
|
+
|
42
|
+
def to_str(self) -> str:
|
43
|
+
"""Returns the string representation of the model using alias"""
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
|
+
|
46
|
+
def to_json(self) -> str:
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
49
|
+
return json.dumps(self.to_dict())
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
+
"""Create an instance of FoursquareAddendum from a JSON string"""
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
55
|
+
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
58
|
+
|
59
|
+
This has the following differences from calling pydantic's
|
60
|
+
`self.model_dump(by_alias=True)`:
|
61
|
+
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
63
|
+
were set at model initialization. Other fields with value `None`
|
64
|
+
are ignored.
|
65
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
66
|
+
"""
|
67
|
+
excluded_fields: Set[str] = set([
|
68
|
+
"additional_properties",
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
76
|
+
# puts key-value pairs in additional_properties in the top level
|
77
|
+
if self.additional_properties is not None:
|
78
|
+
for _key, _value in self.additional_properties.items():
|
79
|
+
_dict[_key] = _value
|
80
|
+
|
81
|
+
# set to None if tel (nullable) is None
|
82
|
+
# and model_fields_set contains the field
|
83
|
+
if self.tel is None and "tel" in self.model_fields_set:
|
84
|
+
_dict['tel'] = None
|
85
|
+
|
86
|
+
# set to None if website (nullable) is None
|
87
|
+
# and model_fields_set contains the field
|
88
|
+
if self.website is None and "website" in self.model_fields_set:
|
89
|
+
_dict['website'] = None
|
90
|
+
|
91
|
+
return _dict
|
92
|
+
|
93
|
+
@classmethod
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
95
|
+
"""Create an instance of FoursquareAddendum from a dict"""
|
96
|
+
if obj is None:
|
97
|
+
return None
|
98
|
+
|
99
|
+
if not isinstance(obj, dict):
|
100
|
+
return cls.model_validate(obj)
|
101
|
+
|
102
|
+
_obj = cls.model_validate({
|
103
|
+
"tel": obj.get("tel"),
|
104
|
+
"website": obj.get("website")
|
105
|
+
})
|
106
|
+
# store additional fields in additional_properties
|
107
|
+
for _key in obj.keys():
|
108
|
+
if _key not in cls.__properties:
|
109
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
110
|
+
|
111
|
+
return _obj
|
112
|
+
|
113
|
+
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|