@@ -2775,52 +2775,14 @@ async def add_pilot_stamps(
2775
2775
2776
2776
return deserialized # type: ignore
2777
2777
2778
- @overload
2779
- async def delete_pilots (
2780
- self , body : List [str ], * , content_type : str = "application/json" , ** kwargs : Any
2781
- ) -> None :
2782
- """Delete Pilots.
2783
-
2784
- Endpoint to delete a pilot.
2785
-
2786
- :param body: Required.
2787
- :type body: list[str]
2788
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2789
- Default value is "application/json".
2790
- :paramtype content_type: str
2791
- :return: None
2792
- :rtype: None
2793
- :raises ~azure.core.exceptions.HttpResponseError:
2794
- """
2795
-
2796
- @overload
2797
- async def delete_pilots (
2798
- self , body : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
2799
- ) -> None :
2800
- """Delete Pilots.
2801
-
2802
- Endpoint to delete a pilot.
2803
-
2804
- :param body: Required.
2805
- :type body: IO[bytes]
2806
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2807
- Default value is "application/json".
2808
- :paramtype content_type: str
2809
- :return: None
2810
- :rtype: None
2811
- :raises ~azure.core.exceptions.HttpResponseError:
2812
- """
2813
-
2814
2778
@distributed_trace_async
2815
- async def delete_pilots (
2816
- self , body : Union [List [str ], IO [bytes ]], ** kwargs : Any
2817
- ) -> None :
2779
+ async def delete_pilots (self , * , pilot_stamps : List [str ], ** kwargs : Any ) -> None :
2818
2780
"""Delete Pilots.
2819
2781
2820
2782
Endpoint to delete a pilot.
2821
2783
2822
- :param body: Is either a [str] type or a IO[bytes] type . Required.
2823
- :type body : list[str] or IO[bytes ]
2784
+ :keyword pilot_stamps: Stamps of the pilots we want to delete . Required.
2785
+ :paramtype pilot_stamps : list[str]
2824
2786
:return: None
2825
2787
:rtype: None
2826
2788
:raises ~azure.core.exceptions.HttpResponseError:
@@ -2833,26 +2795,13 @@ async def delete_pilots(
2833
2795
}
2834
2796
error_map .update (kwargs .pop ("error_map" , {}) or {})
2835
2797
2836
- _headers = case_insensitive_dict ( kwargs .pop ("headers" , {}) or {})
2798
+ _headers = kwargs .pop ("headers" , {}) or {}
2837
2799
_params = kwargs .pop ("params" , {}) or {}
2838
2800
2839
- content_type : Optional [str ] = kwargs .pop (
2840
- "content_type" , _headers .pop ("Content-Type" , None )
2841
- )
2842
2801
cls : ClsType [None ] = kwargs .pop ("cls" , None )
2843
2802
2844
- content_type = content_type or "application/json"
2845
- _json = None
2846
- _content = None
2847
- if isinstance (body , (IOBase , bytes )):
2848
- _content = body
2849
- else :
2850
- _json = self ._serialize .body (body , "[str]" )
2851
-
2852
2803
_request = build_pilots_delete_pilots_request (
2853
- content_type = content_type ,
2854
- json = _json ,
2855
- content = _content ,
2804
+ pilot_stamps = pilot_stamps ,
2856
2805
headers = _headers ,
2857
2806
params = _params ,
2858
2807
)
@@ -2876,56 +2825,21 @@ async def delete_pilots(
2876
2825
if cls :
2877
2826
return cls (pipeline_response , None , {}) # type: ignore
2878
2827
2879
- @overload
2880
- async def clear_pilots (
2881
- self ,
2882
- body : _models .BodyPilotsClearPilots ,
2883
- * ,
2884
- content_type : str = "application/json" ,
2885
- ** kwargs : Any ,
2886
- ) -> None :
2887
- """Clear Pilots.
2888
-
2889
- Delete all pilots that lived more than age_in_days.
2890
-
2891
- :param body: Required.
2892
- :type body: ~_generated.models.BodyPilotsClearPilots
2893
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2894
- Default value is "application/json".
2895
- :paramtype content_type: str
2896
- :return: None
2897
- :rtype: None
2898
- :raises ~azure.core.exceptions.HttpResponseError:
2899
- """
2900
-
2901
- @overload
2902
- async def clear_pilots (
2903
- self , body : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
2904
- ) -> None :
2905
- """Clear Pilots.
2906
-
2907
- Delete all pilots that lived more than age_in_days.
2908
-
2909
- :param body: Required.
2910
- :type body: IO[bytes]
2911
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2912
- Default value is "application/json".
2913
- :paramtype content_type: str
2914
- :return: None
2915
- :rtype: None
2916
- :raises ~azure.core.exceptions.HttpResponseError:
2917
- """
2918
-
2919
2828
@distributed_trace_async
2920
2829
async def clear_pilots (
2921
- self , body : Union [ _models . BodyPilotsClearPilots , IO [ bytes ]] , ** kwargs : Any
2830
+ self , * , age_in_days : int , delete_only_aborted : bool = True , ** kwargs : Any
2922
2831
) -> None :
2923
2832
"""Clear Pilots.
2924
2833
2925
2834
Delete all pilots that lived more than age_in_days.
2926
2835
2927
- :param body: Is either a BodyPilotsClearPilots type or a IO[bytes] type. Required.
2928
- :type body: ~_generated.models.BodyPilotsClearPilots or IO[bytes]
2836
+ :keyword age_in_days: The number of days that define the maximum age of pilots to be
2837
+ deleted.Pilots older than this age will be considered for deletion. Required.
2838
+ :paramtype age_in_days: int
2839
+ :keyword delete_only_aborted: Flag indicating whether to only delete pilots whose status is
2840
+ 'Aborted'.If set to True, only pilots with the 'Aborted' status will be deleted.It is set by
2841
+ default as True to avoid any mistake. Default value is True.
2842
+ :paramtype delete_only_aborted: bool
2929
2843
:return: None
2930
2844
:rtype: None
2931
2845
:raises ~azure.core.exceptions.HttpResponseError:
@@ -2938,26 +2852,14 @@ async def clear_pilots(
2938
2852
}
2939
2853
error_map .update (kwargs .pop ("error_map" , {}) or {})
2940
2854
2941
- _headers = case_insensitive_dict ( kwargs .pop ("headers" , {}) or {})
2855
+ _headers = kwargs .pop ("headers" , {}) or {}
2942
2856
_params = kwargs .pop ("params" , {}) or {}
2943
2857
2944
- content_type : Optional [str ] = kwargs .pop (
2945
- "content_type" , _headers .pop ("Content-Type" , None )
2946
- )
2947
2858
cls : ClsType [None ] = kwargs .pop ("cls" , None )
2948
2859
2949
- content_type = content_type or "application/json"
2950
- _json = None
2951
- _content = None
2952
- if isinstance (body , (IOBase , bytes )):
2953
- _content = body
2954
- else :
2955
- _json = self ._serialize .body (body , "BodyPilotsClearPilots" )
2956
-
2957
2860
_request = build_pilots_clear_pilots_request (
2958
- content_type = content_type ,
2959
- json = _json ,
2960
- content = _content ,
2861
+ age_in_days = age_in_days ,
2862
+ delete_only_aborted = delete_only_aborted ,
2961
2863
headers = _headers ,
2962
2864
params = _params ,
2963
2865
)
@@ -3350,7 +3252,7 @@ async def associate_pilots_with_secrets(
3350
3252
@overload
3351
3253
async def update_pilot_fields (
3352
3254
self ,
3353
- body : List [ _models .PilotFieldsMapping ] ,
3255
+ body : _models .BodyPilotsUpdatePilotFields ,
3354
3256
* ,
3355
3257
content_type : str = "application/json" ,
3356
3258
** kwargs : Any ,
@@ -3360,7 +3262,7 @@ async def update_pilot_fields(
3360
3262
Modify a field of a pilot.
3361
3263
3362
3264
:param body: Required.
3363
- :type body: list[ ~_generated.models.PilotFieldsMapping]
3265
+ :type body: ~_generated.models.BodyPilotsUpdatePilotFields
3364
3266
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
3365
3267
Default value is "application/json".
3366
3268
:paramtype content_type: str
@@ -3389,14 +3291,14 @@ async def update_pilot_fields(
3389
3291
3390
3292
@distributed_trace_async
3391
3293
async def update_pilot_fields (
3392
- self , body : Union [List [ _models .PilotFieldsMapping ] , IO [bytes ]], ** kwargs : Any
3294
+ self , body : Union [_models .BodyPilotsUpdatePilotFields , IO [bytes ]], ** kwargs : Any
3393
3295
) -> None :
3394
3296
"""Update Pilot Fields.
3395
3297
3396
3298
Modify a field of a pilot.
3397
3299
3398
- :param body: Is either a [PilotFieldsMapping] type or a IO[bytes] type. Required.
3399
- :type body: list[ ~_generated.models.PilotFieldsMapping] or IO[bytes]
3300
+ :param body: Is either a BodyPilotsUpdatePilotFields type or a IO[bytes] type. Required.
3301
+ :type body: ~_generated.models.BodyPilotsUpdatePilotFields or IO[bytes]
3400
3302
:return: None
3401
3303
:rtype: None
3402
3304
:raises ~azure.core.exceptions.HttpResponseError:
@@ -3423,7 +3325,7 @@ async def update_pilot_fields(
3423
3325
if isinstance (body , (IOBase , bytes )):
3424
3326
_content = body
3425
3327
else :
3426
- _json = self ._serialize .body (body , "[PilotFieldsMapping] " )
3328
+ _json = self ._serialize .body (body , "BodyPilotsUpdatePilotFields " )
3427
3329
3428
3330
_request = build_pilots_update_pilot_fields_request (
3429
3331
content_type = content_type ,
0 commit comments