File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -407,6 +407,41 @@ def delete_alert(
407407 headers = http_headers ,
408408 )
409409
410+ def list_alert_logs (
411+ self ,
412+ alert_id : Union [UUID , str ],
413+ page : int = 1 ,
414+ per_page : int = 10 ,
415+ all : bool = False ,
416+ * ,
417+ http_headers : Optional [Dict ] = None ,
418+ ) -> PaginatedResponse [AlertLog ]:
419+ """
420+ List alert logs.
421+
422+ https://docs.asknews.app/en/reference#get-/v1/chat/alerts
423+
424+ :param alert_id: The alert ID.
425+ :type alert_id: Union[UUID, str]
426+ :param page: The page number.
427+ :type page: int
428+ :param per_page: The number of items per page.
429+ :type per_page: int
430+ :param all: Whether to return all alerts.
431+ :type all: bool
432+ :param http_headers: Additional HTTP headers.
433+ :type http_headers: Optional[Dict]
434+ :return: List of alerts.
435+ :rtype: PaginatedResponse[AlertResponse]
436+ """
437+ response = self .client .request (
438+ method = "GET" ,
439+ endpoint = f"/v1/chat/alerts/{ alert_id } /logs" ,
440+ headers = http_headers ,
441+ query = {"page" : page , "per_page" : per_page , "all" : all },
442+ )
443+ return PaginatedResponse [AlertLog ].model_validate (response .content )
444+
410445
411446class AsyncChatAPI (BaseAPI ):
412447 """
You can’t perform that action at this time.
0 commit comments