59
59
build_pilots_clear_pilots_request ,
60
60
build_pilots_create_pilot_secrets_request ,
61
61
build_pilots_delete_pilots_request ,
62
- build_pilots_get_logs_request ,
63
62
build_pilots_pilot_login_request ,
64
63
build_pilots_refresh_pilot_tokens_request ,
64
+ build_pilots_search_logs_request ,
65
65
build_pilots_search_request ,
66
66
build_pilots_send_message_request ,
67
67
build_pilots_update_pilot_fields_request ,
@@ -3480,7 +3480,7 @@ async def send_message(
3480
3480
* ,
3481
3481
content_type : str = "application/json" ,
3482
3482
** kwargs : Any ,
3483
- ) -> int :
3483
+ ) -> None :
3484
3484
"""Send Message.
3485
3485
3486
3486
Send Message.
@@ -3490,15 +3490,15 @@ async def send_message(
3490
3490
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
3491
3491
Default value is "application/json".
3492
3492
:paramtype content_type: str
3493
- :return: int
3494
- :rtype: int
3493
+ :return: None
3494
+ :rtype: None
3495
3495
:raises ~azure.core.exceptions.HttpResponseError:
3496
3496
"""
3497
3497
3498
3498
@overload
3499
3499
async def send_message (
3500
3500
self , body : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
3501
- ) -> int :
3501
+ ) -> None :
3502
3502
"""Send Message.
3503
3503
3504
3504
Send Message.
@@ -3508,23 +3508,23 @@ async def send_message(
3508
3508
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
3509
3509
Default value is "application/json".
3510
3510
:paramtype content_type: str
3511
- :return: int
3512
- :rtype: int
3511
+ :return: None
3512
+ :rtype: None
3513
3513
:raises ~azure.core.exceptions.HttpResponseError:
3514
3514
"""
3515
3515
3516
3516
@distributed_trace_async
3517
3517
async def send_message (
3518
3518
self , body : Union [_models .LogMessage , IO [bytes ]], ** kwargs : Any
3519
- ) -> int :
3519
+ ) -> None :
3520
3520
"""Send Message.
3521
3521
3522
3522
Send Message.
3523
3523
3524
3524
:param body: Is either a LogMessage type or a IO[bytes] type. Required.
3525
3525
:type body: ~_generated.models.LogMessage or IO[bytes]
3526
- :return: int
3527
- :rtype: int
3526
+ :return: None
3527
+ :rtype: None
3528
3528
:raises ~azure.core.exceptions.HttpResponseError:
3529
3529
"""
3530
3530
error_map : MutableMapping = {
@@ -3541,7 +3541,7 @@ async def send_message(
3541
3541
content_type : Optional [str ] = kwargs .pop (
3542
3542
"content_type" , _headers .pop ("Content-Type" , None )
3543
3543
)
3544
- cls : ClsType [int ] = kwargs .pop ("cls" , None )
3544
+ cls : ClsType [None ] = kwargs .pop ("cls" , None )
3545
3545
3546
3546
content_type = content_type or "application/json"
3547
3547
_json = None
@@ -3569,27 +3569,90 @@ async def send_message(
3569
3569
3570
3570
response = pipeline_response .http_response
3571
3571
3572
- if response .status_code not in [200 ]:
3572
+ if response .status_code not in [204 ]:
3573
3573
map_error (
3574
3574
status_code = response .status_code , response = response , error_map = error_map
3575
3575
)
3576
3576
raise HttpResponseError (response = response )
3577
3577
3578
- deserialized = self ._deserialize ("int" , pipeline_response .http_response )
3579
-
3580
3578
if cls :
3581
- return cls (pipeline_response , deserialized , {}) # type: ignore
3579
+ return cls (pipeline_response , None , {}) # type: ignore
3582
3580
3583
- return deserialized # type: ignore
3581
+ @overload
3582
+ async def search_logs (
3583
+ self ,
3584
+ body : Optional [_models .SearchParams ] = None ,
3585
+ * ,
3586
+ page : int = 1 ,
3587
+ per_page : int = 100 ,
3588
+ content_type : str = "application/json" ,
3589
+ ** kwargs : Any ,
3590
+ ) -> List [Dict [str , Any ]]:
3591
+ """Search Logs.
3592
+
3593
+ Search Logs.
3594
+
3595
+ :param body: Default value is None.
3596
+ :type body: ~_generated.models.SearchParams
3597
+ :keyword page: Default value is 1.
3598
+ :paramtype page: int
3599
+ :keyword per_page: Default value is 100.
3600
+ :paramtype per_page: int
3601
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
3602
+ Default value is "application/json".
3603
+ :paramtype content_type: str
3604
+ :return: list of dict mapping str to any
3605
+ :rtype: list[dict[str, any]]
3606
+ :raises ~azure.core.exceptions.HttpResponseError:
3607
+ """
3608
+
3609
+ @overload
3610
+ async def search_logs (
3611
+ self ,
3612
+ body : Optional [IO [bytes ]] = None ,
3613
+ * ,
3614
+ page : int = 1 ,
3615
+ per_page : int = 100 ,
3616
+ content_type : str = "application/json" ,
3617
+ ** kwargs : Any ,
3618
+ ) -> List [Dict [str , Any ]]:
3619
+ """Search Logs.
3620
+
3621
+ Search Logs.
3622
+
3623
+ :param body: Default value is None.
3624
+ :type body: IO[bytes]
3625
+ :keyword page: Default value is 1.
3626
+ :paramtype page: int
3627
+ :keyword per_page: Default value is 100.
3628
+ :paramtype per_page: int
3629
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
3630
+ Default value is "application/json".
3631
+ :paramtype content_type: str
3632
+ :return: list of dict mapping str to any
3633
+ :rtype: list[dict[str, any]]
3634
+ :raises ~azure.core.exceptions.HttpResponseError:
3635
+ """
3584
3636
3585
3637
@distributed_trace_async
3586
- async def get_logs (self , * , pilot_id : int , ** kwargs : Any ) -> List [Dict [str , Any ]]:
3587
- """Get Logs.
3638
+ async def search_logs (
3639
+ self ,
3640
+ body : Optional [Union [_models .SearchParams , IO [bytes ]]] = None ,
3641
+ * ,
3642
+ page : int = 1 ,
3643
+ per_page : int = 100 ,
3644
+ ** kwargs : Any ,
3645
+ ) -> List [Dict [str , Any ]]:
3646
+ """Search Logs.
3588
3647
3589
- Get Logs.
3648
+ Search Logs.
3590
3649
3591
- :keyword pilot_id: Required.
3592
- :paramtype pilot_id: int
3650
+ :param body: Is either a SearchParams type or a IO[bytes] type. Default value is None.
3651
+ :type body: ~_generated.models.SearchParams or IO[bytes]
3652
+ :keyword page: Default value is 1.
3653
+ :paramtype page: int
3654
+ :keyword per_page: Default value is 100.
3655
+ :paramtype per_page: int
3593
3656
:return: list of dict mapping str to any
3594
3657
:rtype: list[dict[str, any]]
3595
3658
:raises ~azure.core.exceptions.HttpResponseError:
@@ -3602,13 +3665,31 @@ async def get_logs(self, *, pilot_id: int, **kwargs: Any) -> List[Dict[str, Any]
3602
3665
}
3603
3666
error_map .update (kwargs .pop ("error_map" , {}) or {})
3604
3667
3605
- _headers = kwargs .pop ("headers" , {}) or {}
3668
+ _headers = case_insensitive_dict ( kwargs .pop ("headers" , {}) or {})
3606
3669
_params = kwargs .pop ("params" , {}) or {}
3607
3670
3671
+ content_type : Optional [str ] = kwargs .pop (
3672
+ "content_type" , _headers .pop ("Content-Type" , None )
3673
+ )
3608
3674
cls : ClsType [List [Dict [str , Any ]]] = kwargs .pop ("cls" , None )
3609
3675
3610
- _request = build_pilots_get_logs_request (
3611
- pilot_id = pilot_id ,
3676
+ content_type = content_type or "application/json"
3677
+ _json = None
3678
+ _content = None
3679
+ if isinstance (body , (IOBase , bytes )):
3680
+ _content = body
3681
+ else :
3682
+ if body is not None :
3683
+ _json = self ._serialize .body (body , "SearchParams" )
3684
+ else :
3685
+ _json = None
3686
+
3687
+ _request = build_pilots_search_logs_request (
3688
+ page = page ,
3689
+ per_page = per_page ,
3690
+ content_type = content_type ,
3691
+ json = _json ,
3692
+ content = _content ,
3612
3693
headers = _headers ,
3613
3694
params = _params ,
3614
3695
)
0 commit comments