22
22
RouteMatrixQuery ,
23
23
RouteMatrixResult ,
24
24
BatchRequest ,
25
- BatchRequestItem
25
+ BatchRequestItem ,
26
26
)
27
27
from ._operations import RouteOperations as RouteOperationsGenerated
28
28
@@ -36,12 +36,12 @@ def patch_sdk():
36
36
you can't accomplish using the techniques described in
37
37
https://aka.ms/azsdk/python/dpcodegen/python/customize
38
38
"""
39
+
40
+
39
41
class RouteOperations (RouteOperationsGenerated ):
40
42
@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
45
45
) -> RouteDirections :
46
46
"""
47
47
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
269
269
coordinates .append (f"{ route_point [0 ]} ,{ route_point [1 ]} " )
270
270
query_items = ":" .join (coordinates )
271
271
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 )
276
276
277
277
if supporting_points or avoid_areas or allow_vignette or avoid_vignette :
278
278
route_directions_body = RouteDirectionParameters (
279
279
supporting_points = supporting_points ,
280
280
avoid_vignette = avoid_vignette ,
281
281
allow_vignette = allow_vignette ,
282
- avoid_areas = avoid_areas
282
+ avoid_areas = avoid_areas ,
283
283
)
284
284
return await super ().get_route_directions_with_additional_parameters (
285
285
route_direction_parameters = route_directions_body ,
286
286
format = ResponseFormat .JSON ,
287
287
route_points = query_items ,
288
- ** kwargs
288
+ ** kwargs ,
289
289
)
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 )
295
291
296
292
# cSpell:disable
297
293
@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
302
296
) -> RouteRangeResult :
303
-
304
297
"""**Route Range (Isochrone) API**
305
298
306
299
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
461
454
elif isinstance (coordinates , LatLongPair ) and coordinates .latitude and coordinates .longitude :
462
455
query = [coordinates .latitude , coordinates .longitude ]
463
456
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 )
470
458
471
459
@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 :
478
461
"""Sends batches of route directions requests.
479
462
The method return the result directly.
480
463
@@ -491,15 +474,13 @@ async def get_route_directions_batch_sync(
491
474
route_directions_batch_queries = BatchRequest (
492
475
batch_items = [BatchRequestItem (query = f"?query={ query } " ) for query in queries ] if queries else []
493
476
),
494
- ** kwargs
477
+ ** kwargs ,
495
478
)
496
479
497
480
@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
501
483
) -> AsyncLROPoller [RouteDirectionsBatchResult ]:
502
-
503
484
"""Sends batches of route direction queries.
504
485
The method returns a poller for retrieving the result later.
505
486
@@ -520,14 +501,12 @@ async def begin_get_route_directions_batch( # type: ignore
520
501
:rtype: ~azure.core.polling.AsyncLROPoller[RouteDirectionsBatchResult]
521
502
:raises ~azure.core.exceptions.HttpResponseError:
522
503
"""
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 )
525
506
526
507
if batch_id :
527
508
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
531
510
)
532
511
return poller
533
512
@@ -536,25 +515,20 @@ async def begin_get_route_directions_batch( # type: ignore
536
515
route_directions_batch_queries = BatchRequest (
537
516
batch_items = [BatchRequestItem (query = f"?query={ query } " ) for query in queries ] if queries else []
538
517
),
539
- ** kwargs
518
+ ** kwargs ,
540
519
)
541
520
542
521
polling_method = batch_poller .polling_method ()
543
522
if hasattr (polling_method , "_operation" ):
544
523
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 ]
546
525
else :
547
526
batch_poller .batch_id = None
548
527
549
528
return batch_poller
550
529
551
530
@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 :
558
532
"""
559
533
Calculates a matrix of route summaries for a set of routes defined by origin and destination locations.
560
534
The method return the result directly.
@@ -659,18 +633,10 @@ async def get_route_matrix(
659
633
:rtype: ~azure.maps.route.models.RouteMatrixResult
660
634
:raises ~azure.core.exceptions.HttpResponseError:
661
635
"""
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 )
667
637
668
638
@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 ]:
674
640
"""
675
641
Calculates a matrix of route summaries for a set of routes defined by origin and destination locations.
676
642
The method returns a poller for retrieving the result later.
@@ -785,18 +751,13 @@ async def begin_get_route_matrix_batch(
785
751
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.maps.route.models.RouteMatrixResult]
786
752
:raises ~azure.core.exceptions.HttpResponseError:
787
753
"""
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 )
790
756
791
757
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 )
796
759
797
760
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
801
762
)
802
763
return poller
0 commit comments