13
13
from .._generated .models import (
14
14
BatchResult as GenBatchResult ,
15
15
RouteLeg as GenRouteLeg ,
16
- BatchResultSummary
16
+ BatchResultSummary ,
17
+ ErrorDetail ,
18
+ RouteReport ,
19
+ RouteSectionTec
17
20
)
18
21
19
22
class LatLon (NamedTuple ):
@@ -44,30 +47,170 @@ class BoundingBox(NamedTuple):
44
47
east : float = 0.0
45
48
north : float = 0.0
46
49
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
+
47
190
class RouteDirectionsBatchItem (object ):
48
191
"""An item returned from Route Directions Batch service call.
49
192
50
193
Variables are only populated by the server, and will be ignored when sending a request.
51
194
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,
53
196
ErrorResponse otherwise.
54
- :vartype response: ~azure.maps.route.models.RouteDirectionsBatchItemResponse
197
+ :vartype result: RouteDirectionsBatchItemResult
55
198
"""
56
199
57
200
_validation = {
58
- "response " : {"readonly" : True },
201
+ "result " : {"readonly" : True },
59
202
}
60
203
61
204
_attribute_map = {
62
- "response " : {"key" : "response " , "type" : "RouteDirectionsBatchItemResponse " },
205
+ "result " : {"key" : "result " , "type" : "RouteDirectionsBatchItemResult " },
63
206
}
64
207
65
208
def __init__ (self , ** kwargs ):
66
209
""" """
67
210
super ().__init__ (** kwargs )
68
- self .response = None
211
+ self .result = None
69
212
70
- class RouteDirectionsBatchResult (GenBatchResult ):
213
+ class RouteDirectionsBatchResult (object ):
71
214
"""This object is returned from a successful Route Directions Batch service call.
72
215
73
216
Variables are only populated by the server, and will be ignored when sending a request.
@@ -808,3 +951,28 @@ def __init__(
808
951
super (GeoJsonPolygon , self ).__init__ (coordinates = coordinates , ** kwargs )
809
952
self .coordinates = coordinates
810
953
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