Skip to content

Commit dcbcc9a

Browse files
committed
update release date & minor naming & clean up`
1 parent 259ac86 commit dcbcc9a

File tree

4 files changed

+187
-16
lines changed

4 files changed

+187
-16
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Release History
22

3-
## 1.0.0b1 (2022-10-11)
3+
## 1.0.0b1 (2022-10-13)
44

55
* Initial Release

sdk/maps/azure-maps-route/azure/maps/route/_route_client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
RouteRangeResult,
1717
RouteMatrixResult,
1818
RouteMatrixQuery,
19-
LatLon
19+
LatLon,
20+
TravelMode
2021
)
2122

2223
from ._generated.models import (

sdk/maps/azure-maps-route/azure/maps/route/models/__init__.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717
RouteMatrixQuery,
1818
RouteMatrixResult,
1919
RouteMatrixSummary,
20-
RouteDirectionsBatchItem,
2120
RouteOptimizedWaypoint,
2221
RouteSummary,
23-
RouteSection,
2422
RouteGuidance,
25-
Route
23+
Route,
24+
RouteSectionTec
2625
)
2726

2827
from ._models import (
@@ -42,7 +41,9 @@
4241
GeoJsonGeometryCollection,
4342
RouteDirectionsBatchResult,
4443
RouteDirectionsBatchItem,
45-
RouteLeg
44+
RouteLeg,
45+
TravelMode,
46+
RouteDirectionsBatchItemResult
4647
)
4748

4849

@@ -62,15 +63,13 @@
6263
'VehicleLoadType',
6364
'VehicleEngineType',
6465
'RouteDirectionsBatchResult',
65-
'RouteDirectionsBatchItem',
6666
'RouteRepresentationForBestOrder',
6767
'AlternativeRouteType',
6868
'RouteMatrixQuery',
6969
'RouteMatrixResult',
7070
'Route',
7171
'RouteLeg',
7272
'RouteSummary',
73-
'RouteSection',
7473
'RouteGuidance',
7574
'RouteMatrixSummary',
7675
'RouteDirectionsBatchItem',
@@ -86,5 +85,8 @@
8685
'GeoJsonMultiPolygon',
8786
'GeoJsonPoint',
8887
'GeoJsonPolygon',
89-
'GeoJsonGeometryCollection'
88+
'GeoJsonGeometryCollection',
89+
'TravelMode',
90+
'RouteDirectionsBatchItemResult',
91+
'RouteSectionTec'
9092
]

sdk/maps/azure-maps-route/azure/maps/route/models/_models.py

+175-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
from .._generated.models import (
1414
BatchResult as GenBatchResult,
1515
RouteLeg as GenRouteLeg,
16-
BatchResultSummary
16+
BatchResultSummary,
17+
ErrorDetail,
18+
RouteReport,
19+
RouteSectionTec
1720
)
1821

1922
class LatLon(NamedTuple):
@@ -44,30 +47,170 @@ class BoundingBox(NamedTuple):
4447
east: float = 0.0
4548
north: float = 0.0
4649

50+
# cSpell:disable
51+
class RouteSection(object):
52+
"""Route sections contain additional information about parts of a route. Each section contains at least the elements ``startPointIndex``\ , ``endPointIndex``\ , and ``sectionType``.
53+
54+
Variables are only populated by the server, and will be ignored when sending a request.
55+
56+
:ivar start_point_index: Index of the first point (offset 0) in the route this section applies
57+
to.
58+
:vartype start_point_index: int
59+
:ivar end_point_index: Index of the last point (offset 0) in the route this section applies to.
60+
:vartype end_point_index: int
61+
:ivar section_type: Section types of the reported route response. Known values are:
62+
"CAR_TRAIN", "COUNTRY", "FERRY", "MOTORWAY", "PEDESTRIAN", "TOLL_ROAD", "TOLL_VIGNETTE",
63+
"TRAFFIC", "TRAVEL_MODE", "TUNNEL", "CARPOOL", and "URBAN".
64+
:vartype section_type: str or ~azure.maps.route.models.SectionType
65+
:ivar travel_mode: Travel mode for the calculated route. The value will be set to ``other`` if
66+
the requested mode of transport is not possible in this section. Known values are: "car",
67+
"truck", "taxi", "bus", "van", "motorcycle", "bicycle", "pedestrian", and "other".
68+
:vartype travel_mode: str or ~azure.maps.route.models.TravelMode
69+
:ivar simple_category: Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or
70+
OTHER. See "tec" for detailed information. Known values are: "JAM", "ROAD_WORK",
71+
"ROAD_CLOSURE", and "OTHER".
72+
:vartype simple_category: str or ~azure.maps.route.models.SimpleCategory
73+
:ivar effective_speed_in_kmh: Effective speed of the incident in km/h, averaged over its entire
74+
length.
75+
:vartype effective_speed_in_kmh: int
76+
:ivar delay_in_seconds: Delay in seconds caused by the incident.
77+
:vartype delay_in_seconds: int
78+
:ivar delay_magnitude: The magnitude of delay caused by the incident. These values correspond
79+
to the values of the response field ty of the `Get Traffic Incident Detail API
80+
<https://docs.microsoft.com/rest/api/maps/traffic/gettrafficincidentdetail>`_. Known values
81+
are: "0", "1", "2", "3", and "4".
82+
:vartype delay_magnitude: str or ~azure.maps.route.models.DelayMagnitude
83+
:ivar tec: Details of the traffic event, using definitions in the `TPEG2-TEC
84+
<https://www.iso.org/standard/63116.html>`_ standard. Can contain effectCode and causes
85+
elements.
86+
:vartype tec: ~azure.maps.route.models.RouteSectionTec
87+
"""
88+
89+
_validation = {
90+
"start_point_index": {"readonly": True},
91+
"end_point_index": {"readonly": True},
92+
"section_type": {"readonly": True},
93+
"travel_mode": {"readonly": True},
94+
"simple_category": {"readonly": True},
95+
"effective_speed_in_kmh": {"readonly": True},
96+
"delay_in_seconds": {"readonly": True},
97+
"delay_magnitude": {"readonly": True},
98+
}
99+
100+
_attribute_map = {
101+
"start_point_index": {"key": "startPointIndex", "type": "int"},
102+
"end_point_index": {"key": "endPointIndex", "type": "int"},
103+
"section_type": {"key": "sectionType", "type": "str"},
104+
"travel_mode": {"key": "travelMode", "type": "str"},
105+
"simple_category": {"key": "simpleCategory", "type": "str"},
106+
"effective_speed_in_kmh": {"key": "effectiveSpeedInKmh", "type": "int"},
107+
"delay_in_seconds": {"key": "delayInSeconds", "type": "int"},
108+
"delay_magnitude": {"key": "magnitudeOfDelay", "type": "str"},
109+
"tec": {"key": "tec", "type": "RouteSectionTec"},
110+
}
111+
112+
def __init__(self, *, tec: Optional["RouteSectionTec"] = None, **kwargs):
113+
"""
114+
:keyword tec: Details of the traffic event, using definitions in the `TPEG2-TEC
115+
<https://www.iso.org/standard/63116.html>`_ standard. Can contain effectCode and causes
116+
elements.
117+
:paramtype tec: ~azure.maps.route.models.RouteSectionTec
118+
"""
119+
super().__init__(**kwargs)
120+
self.start_point_index = None
121+
self.end_point_index = None
122+
self.section_type = None
123+
self.travel_mode = None
124+
self.simple_category = None
125+
self.effective_speed_in_kmh = None
126+
self.delay_in_seconds = None
127+
self.delay_magnitude = None
128+
self.tec = tec
129+
130+
class RouteDirectionsBatchItemResult(object):
131+
"""The result of the query. RouteDirections if the query completed successfully, ErrorResponse otherwise.
132+
133+
Variables are only populated by the server, and will be ignored when sending a request.
134+
135+
:ivar error: The error object.
136+
:vartype error: ~azure.maps.route.models.ErrorDetail
137+
:ivar format_version: Format Version property.
138+
:vartype format_version: str
139+
:ivar routes: Routes array.
140+
:vartype routes: list[~azure.maps.route.models.Route]
141+
:ivar optimized_waypoints: Optimized sequence of waypoints. It shows the index from the user
142+
provided waypoint sequence for the original and optimized list. For instance, a response:
143+
144+
.. code-block::
145+
146+
<optimizedWaypoints>
147+
<waypoint providedIndex="0" optimizedIndex="1"/>
148+
<waypoint providedIndex="1" optimizedIndex="2"/>
149+
<waypoint providedIndex="2" optimizedIndex="0"/>
150+
</optimizedWaypoints>
151+
152+
means that the original sequence is [0, 1, 2] and optimized sequence is [1, 2, 0]. Since the
153+
index starts by 0 the original is "first, second, third" while the optimized is "second, third,
154+
first".
155+
:vartype optimized_waypoints: list[~azure.maps.route.models.RouteOptimizedWaypoint]
156+
:ivar report: Reports the effective settings used in the current call.
157+
:vartype report: RouteReport
158+
"""
159+
160+
_validation = {
161+
"format_version": {"readonly": True},
162+
"routes": {"readonly": True},
163+
"optimized_waypoints": {"readonly": True},
164+
}
165+
166+
_attribute_map = {
167+
"error": {"key": "error", "type": "ErrorDetail"},
168+
"format_version": {"key": "formatVersion", "type": "str"},
169+
"routes": {"key": "routes", "type": "[Route]"},
170+
"optimized_waypoints": {"key": "optimizedWaypoints", "type": "[RouteOptimizedWaypoint]"},
171+
"report": {"key": "report", "type": "RouteReport"},
172+
}
173+
174+
def __init__(
175+
self, *, error: Optional["ErrorDetail"] = None, report: Optional["RouteReport"] = None, **kwargs
176+
):
177+
"""
178+
:keyword error: The error object.
179+
:paramtype error: ~azure.maps.route.models.ErrorDetail
180+
:keyword report: Reports the effective settings used in the current call.
181+
:paramtype report: ~azure.maps.route.models.RouteReport
182+
"""
183+
super().__init__(report=report, error=error, **kwargs)
184+
self.error = error
185+
self.format_version = None
186+
self.routes = None
187+
self.optimized_waypoints = None
188+
self.report = report
189+
47190
class RouteDirectionsBatchItem(object):
48191
"""An item returned from Route Directions Batch service call.
49192
50193
Variables are only populated by the server, and will be ignored when sending a request.
51194
52-
:ivar response: The result of the query. RouteDirections if the query completed successfully,
195+
:ivar result: The result of the query. RouteDirections if the query completed successfully,
53196
ErrorResponse otherwise.
54-
:vartype response: ~azure.maps.route.models.RouteDirectionsBatchItemResponse
197+
:vartype result: RouteDirectionsBatchItemResult
55198
"""
56199

57200
_validation = {
58-
"response": {"readonly": True},
201+
"result": {"readonly": True},
59202
}
60203

61204
_attribute_map = {
62-
"response": {"key": "response", "type": "RouteDirectionsBatchItemResponse"},
205+
"result": {"key": "result", "type": "RouteDirectionsBatchItemResult"},
63206
}
64207

65208
def __init__(self, **kwargs):
66209
""" """
67210
super().__init__(**kwargs)
68-
self.response = None
211+
self.result = None
69212

70-
class RouteDirectionsBatchResult(GenBatchResult):
213+
class RouteDirectionsBatchResult(object):
71214
"""This object is returned from a successful Route Directions Batch service call.
72215
73216
Variables are only populated by the server, and will be ignored when sending a request.
@@ -808,3 +951,28 @@ def __init__(
808951
super(GeoJsonPolygon, self).__init__(coordinates=coordinates, **kwargs)
809952
self.coordinates = coordinates
810953
self.type = 'Polygon' # type: str
954+
955+
class TravelMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
956+
"""Travel mode for the calculated route. The value will be set to ``other`` if the requested mode
957+
of transport is not possible in this section.
958+
"""
959+
960+
#: The returned routes are optimized for cars.
961+
CAR = "car"
962+
#: The returned routes are optimized for commercial vehicles, like for trucks.
963+
TRUCK = "truck"
964+
#: The returned routes are optimized for taxis. BETA functionality.
965+
TAXI = "taxi"
966+
#: The returned routes are optimized for buses, including the use of bus only lanes. BETA
967+
#: functionality.
968+
BUS = "bus"
969+
#: The returned routes are optimized for vans. BETA functionality.
970+
VAN = "van"
971+
#: The returned routes are optimized for motorcycles. BETA functionality.
972+
MOTORCYCLE = "motorcycle"
973+
#: The returned routes are optimized for bicycles, including use of bicycle lanes.
974+
BICYCLE = "bicycle"
975+
#: The returned routes are optimized for pedestrians, including the use of sidewalks.
976+
PEDESTRIAN = "pedestrian"
977+
#: The given mode of transport is not possible in this section
978+
OTHER = "other"

0 commit comments

Comments
 (0)