
    i?1i!                        d dl mZ d dlmZmZ d dlmZmZ d dlm	Z	m
Z
 d dlmZ erd dlmZ  G d de	      Z G d	 d
e
      Zy)    )annotations)TYPE_CHECKINGAny)"filter_out_none_values_recursivelyignore_docs)ResourceCollectionClientResourceCollectionClientAsync)_get_schedule_representation)ListPagec                       e Zd ZdZed fd       Zdddd	 	 	 	 	 	 	 	 	 d	dZdddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZ xZS )ScheduleCollectionClientz&Sub-client for manipulating schedules.c                L    |j                  dd      }t        |   |d|i| y)zBInitialize the ScheduleCollectionClient with the passed arguments.resource_path	schedulesNpopsuper__init__selfargskwargsr   	__class__s       /home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/apify_client/clients/resource_clients/schedule_collection.pyr   z!ScheduleCollectionClient.__init__   ,     

?K@$FmFvF    Nlimitoffsetdescc               *    | j                  |||      S )  List the available schedules.

        https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/get-list-of-schedules

        Args:
            limit (int, optional): How many schedules to retrieve
            offset (int, optional): What schedules to include as first when retrieving the list
            desc (bool, optional): Whether to sort the schedules in descending order based on their modification date

        Returns:
            ListPage: The list of available schedules matching the specified filters.
        r   _listr   r   r   r    s       r   listzScheduleCollectionClient.list   s    & zzf4z@@r   nameactionsdescriptiontimezonetitlec          
     d    |sg }t        ||||||||      }	| j                  t        |	            S )  Create a new schedule.

        https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/create-schedule

        Args:
            cron_expression (str): The cron expression used by this schedule
            is_enabled (bool): True if the schedule should be enabled
            is_exclusive (bool): When set to true, don't start actor or actor task if it's still running from the previous schedule.
            name (str, optional): The name of the schedule to create.
            actions (list of dict, optional): Actors or tasks that should be run on this schedule. See the API documentation for exact structure.
            description (str, optional): Description of this schedule
            timezone (str, optional): Timezone in which your cron expression runs
                (TZ database name from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
            title: str, optional): Title of this schedule

        Returns:
            dict: The created schedule.
        cron_expression
is_enabledis_exclusiver(   r)   r*   r+   r,   r
   _creater   
r   r0   r1   r2   r(   r)   r*   r+   r,   schedule_representations
             r   createzScheduleCollectionClient.create,   sG    < G">+!%#	#
 ||>?VWXXr   )r   r   r   r   r   r   returnNone)
r   r   r   
int | Noner   r:   r    bool | Noner8   ListPage[dict])r   r   r0   strr1   boolr2   r>   r(   
str | Noner)   list[dict] | Noner*   r?   r+   r?   r,   r?   r8   dict	__name__
__module____qualname____doc__r   r   r&   r7   __classcell__r   s   @r   r   r      s    0G G !! A&A A 	A
 A 
A6  %)"&# ,Y&,Y ,Y 	,Y
 ,Y ,Y #,Y  ,Y ,Y ,Y 
,Yr   r   c                       e Zd ZdZed fd       Zdddd	 	 	 	 	 	 	 	 	 d	dZdddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZ xZS )ScheduleCollectionClientAsyncz,Async sub-client for manipulating schedules.c                L    |j                  dd      }t        |   |d|i| y)zGInitialize the ScheduleCollectionClientAsync with the passed arguments.r   r   Nr   r   s       r   r   z&ScheduleCollectionClientAsync.__init__^   r   r   Nr   c               F   K   | j                  |||       d{   S 7 w)r"   r   Nr#   r%   s       r   r&   z"ScheduleCollectionClientAsync.listd   s#     & ZZeFZFFFFs   !!r'   c          
        K   |sg }t        ||||||||      }	| j                  t        |	             d{   S 7 w)r.   r/   Nr3   r5   s
             r   r7   z$ScheduleCollectionClientAsync.createy   sQ     < G">+!%#	#
 \\"DE\"]^^^^s   5><>)r   rJ   r   r   r   r   r8   r9   )
r   rJ   r   r:   r   r:   r    r;   r8   r<   )r   rJ   r0   r=   r1   r>   r2   r>   r(   r?   r)   r@   r*   r?   r+   r?   r,   r?   r8   rA   rB   rH   s   @r   rJ   rJ   [   s    6G G !! G+G G 	G
 G 
G6  %)"&# ,_+,_ ,_ 	,_
 ,_ ,_ #,_  ,_ ,_ ,_ 
,_r   rJ   N)
__future__r   typingr   r   apify_shared.utilsr   r   apify_client.clients.baser   r	   .apify_client.clients.resource_clients.scheduler
   apify_shared.modelsr   r   rJ    r   r   <module>rU      s=    " % N ] W,JY7 JYZJ_$A J_r   