
    _jw                        S r SSKJr  SSKJrJrJrJrJrJ	r	  SSK
Jr  SSKJrJrJrJrJrJrJrJrJr   " S S\5      r " S	 S
\5      rg)z(Asynchronous Search Monitors API client.    )annotations)AnyAsyncIteratorDictListOptionalUnion   )SearchMonitorsAsyncBaseClient)	CreateSearchMonitorParamsCreateSearchMonitorResponseListSearchMonitorRunsResponseListSearchMonitorsResponseSearchMonitorSearchMonitorRunSearchMonitorStatusTriggerSearchMonitorResponseUpdateSearchMonitorParamsc                  h    \ rS rSrSrSSS.       SS jjrSS jrSS.SS jjrSS.SS	 jjrS
r	g)AsyncSearchMonitorRunsClient   z5Asynchronous client for managing Search Monitor Runs.Ncursorlimitc                  #    U R                  X#5      nU R                  SU S3SUS9I Sh  vN n[        R                  " U5      $  N7f)a  List all runs for a Search Monitor.

Args:
    monitor_id: The ID of the Search Monitor.
    cursor: Pagination cursor from a previous response.
    limit: Maximum number of results to return.

Returns:
    List of Search Monitor runs with pagination info.
/z/runsGETmethodparamsN)build_pagination_paramsrequestr   model_validate)self
monitor_idr   r   r    responses         Q/home/rurouni/.local/lib/python3.13/site-packages/exa_py/monitors/async_client.pylist!AsyncSearchMonitorRunsClient.list   sW     " --f<
|5!% & 
 
 -;;HEE
s   *A	AA	c                v   #    U R                  SU SU 3SS9I Sh  vN n[        R                  " U5      $  N7f)zGet a specific Search Monitor run.

Args:
    monitor_id: The ID of the Search Monitor.
    run_id: The ID of the run.

Returns:
    The Search Monitor run.
r   z/runs/r   r   N)r"   r   r#   )r$   r%   run_idr&   s       r'   get AsyncSearchMonitorRunsClient.get/   sI      
|6&*5 & 
 
  ..x88
s   979r   c                 #    Sn U R                  XUS9I Sh  vN nUR                   H  nU7v   M
     UR                  (       a  UR                  (       d  gUR                  nMa   NM7f)zIterate through all runs for a Search Monitor, handling pagination automatically.

Args:
    monitor_id: The ID of the Search Monitor.
    limit: Maximum number of results to return per page.

Yields:
    SearchMonitorRun: Each run.
Nr   r(   datahas_morenext_cursor)r$   r%   r   r   r&   runs         r'   list_all%AsyncSearchMonitorRunsClient.list_all>   s^      !YYzYNNH}}	 %$$H,@,@))F N   A)A'AA)c               n   #    / nU R                  XS9  Sh  vN nUR                  U5        M   N
 U$ 7f)zCollect all runs for a Search Monitor into a list.

Args:
    monitor_id: The ID of the Search Monitor.
    limit: Maximum number of results to return per page.

Returns:
    List of all Search Monitor runs.
r/   Nr6   append)r$   r%   r   itemsr5   s        r'   get_all$AsyncSearchMonitorRunsClient.get_allQ   s:      z? 	#LL	?   5202525 )r%   strr   Optional[str]r   Optional[int]returnr   )r%   rA   r,   rA   rD   r   )r%   rA   r   rC   rD   zAsyncIterator[SearchMonitorRun])r%   rA   r   rC   rD   zList[SearchMonitorRun])
__name__
__module____qualname____firstlineno____doc__r(   r-   r6   r=   __static_attributes__r@       r'   r   r      s_    ? !%#FF 	F
 F 
'F.9 IM *& HL  rK   r   c                     ^  \ rS rSr% SrS\S'   SU 4S jjr    SS jrSS jrSSSS	.       SS
 jjr	      SS jr
SS jrSSS.SS jjrSSS.SS jjrSS jrSrU =r$ )AsyncSearchMonitorsClienta   z1Asynchronous client for managing Search Monitors.r   runsc                D   > [         TU ]  U5        [        U5      U l        g )N)super__init__r   rO   )r$   client	__class__s     r'   rR   "AsyncSearchMonitorsClient.__init__f   s     08	rK   c                   #    [        U[        5      (       a  UOUR                  SSS9nU R                  SSUS9I Sh  vN n[        R
                  " U5      $  N7f)zCreate a Search Monitor.

Args:
    params: The monitor creation parameters.

Returns:
    The created Search Monitor with webhookSecret.
Tby_aliasexclude_none POSTr   r2   N)
isinstancedict
model_dumpr"   r   r#   )r$   r    r2   r&   s       r'   create AsyncSearchMonitorsClient.createj   sZ      $FD11vv7H7HRVei7H7jbdCC*99(CC Ds   <AAAc                p   #    U R                  SU 3SS9I Sh  vN n[        R                  " U5      $  N7f)zsGet a Search Monitor by ID.

Args:
    monitor_id: The ID of the Search Monitor.

Returns:
    The Search Monitor.
r   r   r+   Nr"   r   r#   r$   r%   r&   s      r'   r-   AsyncSearchMonitorsClient.gety   s:      *&6uEE++H55 F   646Nstatusr   r   c                  #    U R                  X#5      nUb  XS'   U R                  SSUS9I Sh  vN n[        R                  " U5      $  N7f)zList Search Monitors.

Args:
    status: Filter by monitor status.
    cursor: Pagination cursor from a previous response.
    limit: Maximum number of results to return.

Returns:
    List of Search Monitors with pagination info.
Nrh   rZ   r   r   )r!   r"   r   r#   )r$   rh   r   r   r    r&   s         r'   r(   AsyncSearchMonitorsClient.list   sS     " --f<%8bvFF)88BB Gs   -AA
Ac                   #    [        U[        5      (       a  UOUR                  SSS9nU R                  SU 3SUS9I Sh  vN n[        R
                  " U5      $  N7f)zUpdate a Search Monitor.

Args:
    monitor_id: The ID of the Search Monitor.
    params: The update parameters.

Returns:
    The updated Search Monitor.
TrW   r   PATCHr\   N)r]   r^   r_   r"   r   r#   )r$   r%   r    r2   r&   s        r'   update AsyncSearchMonitorsClient.update   sj      $FD11vv7H7HRVei7H7j
|W4 & 
 
 ++H55
s   ?AAAc                p   #    U R                  SU 3SS9I Sh  vN n[        R                  " U5      $  N7f)zxDelete a Search Monitor.

Args:
    monitor_id: The ID of the Search Monitor.

Returns:
    The deleted Search Monitor.
r   DELETEr+   Nrc   rd   s      r'   delete AsyncSearchMonitorsClient.delete   s:      *&6xHH++H55 Irf   rh   r   c                 #    Sn U R                  XUS9I Sh  vN nUR                   H  nU7v   M
     UR                  (       a  UR                  (       d  gUR                  nMa   NM7f)zIterate through all Search Monitors, handling pagination automatically.

Args:
    status: Filter by monitor status.
    limit: Maximum number of results to return per page.

Yields:
    SearchMonitor: Each monitor.
Nrg   r1   )r$   rh   r   r   r&   monitors         r'   r6   "AsyncSearchMonitorsClient.list_all   s^      !YYf5YQQH#== )$$H,@,@))F Qr8   c               n   #    / nU R                  XS9  Sh  vN nUR                  U5        M   N
 U$ 7f)zCollect all Search Monitors into a list.

Args:
    status: Filter by monitor status.
    limit: Maximum number of results to return per page.

Returns:
    List of all Search Monitors.
rs   Nr:   )r$   rh   r   r<   ru   s        r'   r=   !AsyncSearchMonitorsClient.get_all   s:      !]]&]F 	"'LL!	"Fr?   c                r   #    U R                  SU S3SS9I Sh  vN n[        R                  " U5      $  N7f)zTrigger a Search Monitor run immediately.

Args:
    monitor_id: The ID of the Search Monitor.

Returns:
    TriggerSearchMonitorResponse with 'triggered' boolean.
r   z/triggerr[   r+   N)r"   r   r#   rd   s      r'   trigger!AsyncSearchMonitorsClient.trigger   sE      
|8$V & 
 
 ,::8DD
s   757)rO   )rS   r   )r    z0Union[Dict[str, Any], CreateSearchMonitorParams]rD   r   )r%   rA   rD   r   )rh   Optional[SearchMonitorStatus]r   rB   r   rC   rD   r   )r%   rA   r    z0Union[Dict[str, Any], UpdateSearchMonitorParams]rD   r   )rh   r|   r   rC   rD   zAsyncIterator[SearchMonitor])rh   r|   r   rC   rD   zList[SearchMonitor])r%   rA   rD   r   )rE   rF   rG   rH   rI   __annotations__rR   r`   r-   r(   rm   rq   r6   r=   rz   rJ   __classcell__)rT   s   @r'   rM   rM   a   s    ;
&&9DFD	$D
6 15 $#C .C 	C
 C 
$C.66'W6	6$
6 IMei *& HLdh E ErK   rM   N)rI   
__future__r   typingr   r   r   r   r   r	   
async_baser   typesr   r   r   r   r   r   r   r   r   r   rM   r@   rK   r'   <module>r      sD    . " B B 5
 
 
I#@ IXGE = GErK   