2222 RouteMatrixQuery ,
2323 RouteMatrixResult ,
2424 BatchRequest ,
25- BatchRequestItem
25+ BatchRequestItem ,
2626)
2727from ._operations import RouteOperations as RouteOperationsGenerated
2828
@@ -36,12 +36,12 @@ def patch_sdk():
3636 you can't accomplish using the techniques described in
3737 https://aka.ms/azsdk/python/dpcodegen/python/customize
3838 """
39+
40+
3941class RouteOperations (RouteOperationsGenerated ):
4042 @distributed_trace_async
41- async def get_route_directions ( # type: ignore
42- self ,
43- route_points : Union [List [LatLongPair ], List [Tuple ]],
44- ** kwargs : Any
43+ async def get_route_directions ( # type: ignore
44+ self , route_points : Union [List [LatLongPair ], List [Tuple ]], ** kwargs : Any
4545 ) -> RouteDirections :
4646 """
4747 Returns a route between an origin and a destination, passing through waypoints if they are
@@ -269,38 +269,31 @@ async def get_route_directions( # type: ignore
269269 coordinates .append (f"{ route_point [0 ]} ,{ route_point [1 ]} " )
270270 query_items = ":" .join (coordinates )
271271
272- supporting_points = kwargs .pop (' supporting_points' , None )
273- avoid_vignette = kwargs .pop (' avoid_vignette' , None )
274- allow_vignette = kwargs .pop (' allow_vignette' , None )
275- avoid_areas = kwargs .pop (' avoid_areas' , None )
272+ supporting_points = kwargs .pop (" supporting_points" , None )
273+ avoid_vignette = kwargs .pop (" avoid_vignette" , None )
274+ allow_vignette = kwargs .pop (" allow_vignette" , None )
275+ avoid_areas = kwargs .pop (" avoid_areas" , None )
276276
277277 if supporting_points or avoid_areas or allow_vignette or avoid_vignette :
278278 route_directions_body = RouteDirectionParameters (
279279 supporting_points = supporting_points ,
280280 avoid_vignette = avoid_vignette ,
281281 allow_vignette = allow_vignette ,
282- avoid_areas = avoid_areas
282+ avoid_areas = avoid_areas ,
283283 )
284284 return await super ().get_route_directions_with_additional_parameters (
285285 route_direction_parameters = route_directions_body ,
286286 format = ResponseFormat .JSON ,
287287 route_points = query_items ,
288- ** kwargs
288+ ** kwargs ,
289289 )
290- return await super ().get_route_directions (
291- format = ResponseFormat .JSON ,
292- route_points = query_items ,
293- ** kwargs
294- )
290+ return await super ().get_route_directions (format = ResponseFormat .JSON , route_points = query_items , ** kwargs )
295291
296292 # cSpell:disable
297293 @distributed_trace_async
298- async def get_route_range ( # type: ignore
299- self ,
300- coordinates : Union [LatLongPair , Tuple [float , float ]],
301- ** kwargs : Any
294+ async def get_route_range ( # type: ignore
295+ self , coordinates : Union [LatLongPair , Tuple [float , float ]], ** kwargs : Any
302296 ) -> RouteRangeResult :
303-
304297 """**Route Range (Isochrone) API**
305298
306299 This service will calculate a set of locations that can be reached from the origin point based
@@ -461,20 +454,10 @@ async def get_route_range( # type: ignore
461454 elif isinstance (coordinates , LatLongPair ) and coordinates .latitude and coordinates .longitude :
462455 query = [coordinates .latitude , coordinates .longitude ]
463456
464- return await super ().get_route_range (
465- format = ResponseFormat .JSON ,
466- query = query ,
467- ** kwargs
468- )
469-
457+ return await super ().get_route_range (format = ResponseFormat .JSON , query = query , ** kwargs )
470458
471459 @distributed_trace_async
472- async def get_route_directions_batch_sync (
473- self ,
474- queries : List [str ],
475- ** kwargs : Any
476- ) -> RouteDirectionsBatchResult :
477-
460+ async def get_route_directions_batch_sync (self , queries : List [str ], ** kwargs : Any ) -> RouteDirectionsBatchResult :
478461 """Sends batches of route directions requests.
479462 The method return the result directly.
480463
@@ -491,15 +474,13 @@ async def get_route_directions_batch_sync(
491474 route_directions_batch_queries = BatchRequest (
492475 batch_items = [BatchRequestItem (query = f"?query={ query } " ) for query in queries ] if queries else []
493476 ),
494- ** kwargs
477+ ** kwargs ,
495478 )
496479
497480 @distributed_trace_async
498- async def begin_get_route_directions_batch ( # type: ignore
499- self ,
500- ** kwargs : Any
481+ async def begin_get_route_directions_batch ( # type: ignore
482+ self , ** kwargs : Any
501483 ) -> AsyncLROPoller [RouteDirectionsBatchResult ]:
502-
503484 """Sends batches of route direction queries.
504485 The method returns a poller for retrieving the result later.
505486
@@ -520,14 +501,12 @@ async def begin_get_route_directions_batch( # type: ignore
520501 :rtype: ~azure.core.polling.AsyncLROPoller[RouteDirectionsBatchResult]
521502 :raises ~azure.core.exceptions.HttpResponseError:
522503 """
523- queries = kwargs .pop (' queries' , None )
524- batch_id = kwargs .pop (' batch_id' , None )
504+ queries = kwargs .pop (" queries" , None )
505+ batch_id = kwargs .pop (" batch_id" , None )
525506
526507 if batch_id :
527508 poller = await super ().begin_get_route_directions_batch (
528- format = ResponseFormat .JSON ,
529- batch_id = batch_id ,
530- ** kwargs
509+ format = ResponseFormat .JSON , batch_id = batch_id , ** kwargs
531510 )
532511 return poller
533512
@@ -536,25 +515,20 @@ async def begin_get_route_directions_batch( # type: ignore
536515 route_directions_batch_queries = BatchRequest (
537516 batch_items = [BatchRequestItem (query = f"?query={ query } " ) for query in queries ] if queries else []
538517 ),
539- ** kwargs
518+ ** kwargs ,
540519 )
541520
542521 polling_method = batch_poller .polling_method ()
543522 if hasattr (polling_method , "_operation" ):
544523 operation = polling_method ._operation
545- batch_poller .batch_id = operation ._location_url .split ('/' )[- 1 ].split ('?' )[0 ]
524+ batch_poller .batch_id = operation ._location_url .split ("/" )[- 1 ].split ("?" )[0 ]
546525 else :
547526 batch_poller .batch_id = None
548527
549528 return batch_poller
550529
551530 @distributed_trace_async
552- async def get_route_matrix (
553- self ,
554- query : RouteMatrixQuery ,
555- ** kwargs : Any
556- ) -> RouteMatrixResult :
557-
531+ async def get_route_matrix (self , query : RouteMatrixQuery , ** kwargs : Any ) -> RouteMatrixResult :
558532 """
559533 Calculates a matrix of route summaries for a set of routes defined by origin and destination locations.
560534 The method return the result directly.
@@ -659,18 +633,10 @@ async def get_route_matrix(
659633 :rtype: ~azure.maps.route.models.RouteMatrixResult
660634 :raises ~azure.core.exceptions.HttpResponseError:
661635 """
662- return await super ().request_route_matrix_sync (
663- format = ResponseFormat .JSON ,
664- route_matrix_query = query ,
665- ** kwargs
666- )
636+ return await super ().request_route_matrix_sync (format = ResponseFormat .JSON , route_matrix_query = query , ** kwargs )
667637
668638 @distributed_trace_async
669- async def begin_get_route_matrix_batch (
670- self ,
671- ** kwargs : Any
672- ) -> AsyncLROPoller [RouteMatrixResult ]:
673-
639+ async def begin_get_route_matrix_batch (self , ** kwargs : Any ) -> AsyncLROPoller [RouteMatrixResult ]:
674640 """
675641 Calculates a matrix of route summaries for a set of routes defined by origin and destination locations.
676642 The method returns a poller for retrieving the result later.
@@ -785,18 +751,13 @@ async def begin_get_route_matrix_batch(
785751 :rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteMatrixResult]
786752 :raises ~azure.core.exceptions.HttpResponseError:
787753 """
788- query = kwargs .pop (' query' , None )
789- matrix_id = kwargs .pop (' matrix_id' , None )
754+ query = kwargs .pop (" query" , None )
755+ matrix_id = kwargs .pop (" matrix_id" , None )
790756
791757 if matrix_id :
792- return await super ().begin_get_route_matrix (
793- matrix_id = matrix_id ,
794- ** kwargs
795- )
758+ return await super ().begin_get_route_matrix (matrix_id = matrix_id , ** kwargs )
796759
797760 poller = await super ().begin_request_route_matrix (
798- format = ResponseFormat .JSON ,
799- route_matrix_query = query ,
800- ** kwargs
761+ format = ResponseFormat .JSON , route_matrix_query = query , ** kwargs
801762 )
802763 return poller
0 commit comments