
    _j                        S SK Jr  S SKJrJrJrJr  SSKJrJ	r	J
r
Jr  SSKJr  SSKJr  SSKJr   " S	 S
\5      r " S S\5      rg)    )annotations)DictAnyUnionOptional   )MonitorCreateMonitorParametersUpdateMonitorListMonitorsResponse)WebsetsBaseClient)WebsetsAsyncBaseClient   )MonitorRunsClientc                  j   ^  \ rS rSrSrU 4S 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rU =r$ )MonitorsClient   zClient for managing Monitors.c                D   > [         TU ]  U5        [        U5      U l        g )N)super__init__r   runs)selfclient	__class__s     S/home/rurouni/.local/lib/python3.13/site-packages/exa_py/websets/monitors/client.pyr   MonitorsClient.__init__   s     %f-	    c                N    U R                  SUS9n[        R                  " U5      $ )aI  Create a new Monitor to continuously keep your Websets updated with fresh data.

Monitors automatically run on your defined schedule to ensure your Websets stay current without manual intervention:
- Find new content: Execute search operations to discover fresh items matching your criteria
- Update existing content: Run refresh operations to update items contents and enrichments
- Automated scheduling: Configure frequency, timezone, and execution times

Args:
    params (CreateMonitorParameters): The parameters for creating a monitor.

Returns:
    Monitor: The created monitor.
/v0/monitorsdatarequestr	   model_validater   paramsresponses      r   createMonitorsClient.create   s'     <<V<<%%h//r   c                T    U R                  SU 3SS9n[        R                  " U5      $ )zzGet a specific monitor.

Args:
    monitor_id (str): The id of the Monitor.

Returns:
    Monitor: The retrieved monitor.
/v0/monitors/GETmethodr"   r   
monitor_idr'   s      r   getMonitorsClient.get'   s.     <<-
| <U<K%%h//r   Ncursorlimit	webset_idc                   UUUS.R                  5        VVs0 s H  u  pEUc  M
  XE_M     nnnU R                  SUSS9n[        R                  " U5      $ s  snnf )aG  List all monitors.

Args:
    cursor (str, optional): The cursor to paginate through the results.
    limit (int, optional): The number of results to return (1-200, default 25).
    webset_id (str, optional): The id of the Webset to list monitors for.

Returns:
    ListMonitorsResponse: List of monitors with pagination info.
r4   r5   websetIdr   r,   r&   r.   itemsr#   r   r$   r   r4   r5   r6   kvr&   r'   s           r   listMonitorsClient.list3   sx     !% eg	

  AD 	 
 <<ve<L#228<<
s
   	AAc                V    U R                  SU 3USS9n[        R                  " U5      $ )zUpdate a monitor configuration.

Args:
    monitor_id (str): The id of the Monitor.
    params (UpdateMonitor): The parameters for updating a monitor.

Returns:
    Monitor: The updated monitor.
r+   PATCHr!   r.   r"   r   r0   r&   r'   s       r   updateMonitorsClient.updateJ   s1     <<-
| <6RY<Z%%h//r   c                T    U R                  SU 3SS9n[        R                  " U5      $ )zrDelete a monitor.

Args:
    monitor_id (str): The id of the Monitor.

Returns:
    Monitor: The deleted monitor.
r+   DELETEr-   r"   r/   s      r   deleteMonitorsClient.deleteW   s.     <<-
| <X<N%%h//r   r   r&   z.Union[Dict[str, Any], CreateMonitorParameters]returnr	   r0   strrN   r	   r4   Optional[str]r5   zOptional[int]r6   rR   rN   r   r0   rP   r&   z$Union[Dict[str, Any], UpdateMonitor]rN   r	   __name__
__module____qualname____firstlineno____doc__r   r(   r1   r@   rF   rJ   __static_attributes____classcell__r   s   @r   r   r      s3    '.0"
0 /34lp =.0
0 
0r   r   c                  j   ^  \ rS rSrSrU 4S 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rU =r$ )AsyncMonitorsClientd   z#Async client for managing Monitors.c                J   > [         TU ]  U5        SSKJn  U" U5      U l        g )Nr   )AsyncMonitorRunsClient)r   r   r   ra   )r   r   ra   r   s      r   r   AsyncMonitorsClient.__init__g   s     0*62	r   c                j   #    U R                  SUS9I Sh  vN n[        R                  " U5      $  N7f)zOCreate a new Monitor to continuously keep your Websets updated with fresh data.r   r    Nr"   r%   s      r   r(   AsyncMonitorsClient.createl   s1     n6BB%%h// Cs   313c                p   #    U R                  SU 3SS9I Sh  vN n[        R                  " U5      $  N7f)zGet a specific monitor.r+   r,   r-   Nr"   r/   s      r   r1   AsyncMonitorsClient.getq   s8     j\&B5QQ%%h// R   646Nr3   c                  #    XUS.R                  5        VVs0 s H  u  pEUc  M
  XE_M     nnnU R                  SUSS9I Sh  vN n[        R                  " U5      $ s  snnf  N 7f)zList all monitors.r8   Nr   r,   r:   r;   r=   s           r   r@   AsyncMonitorsClient.listv   sd     .4R[#\#b#b#dv#d41hi$!$#dvnVERR#228<< wRs    A&	AAA&A$!A&c                r   #    U R                  SU 3USS9I Sh  vN n[        R                  " U5      $  N7f)zUpdate a monitor configuration.r+   rC   rD   Nr"   rE   s       r   rF   AsyncMonitorsClient.update|   s;     j\&BX_``%%h// as   757c                p   #    U R                  SU 3SS9I Sh  vN n[        R                  " U5      $  N7f)zDelete a monitor.r+   rI   r-   Nr"   r/   s      r   rJ   AsyncMonitorsClient.delete   s8     j\&B8TT%%h// Urg   rL   rM   rO   rQ   rS   rT   r\   s   @r   r^   r^   d   s4    -3
0
0
 59QUrv =0
0 0r   r^   N)
__future__r   typingr   r   r   r   typesr	   r
   r   r   	core.baser   core.async_baser   r   r   r   r^    r   r   <module>rt      s@    " - -  * 4 #R0& R0j 00  0r   