
    i?1i                        d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
mZ d dlmZmZ 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ G d	 d
e      Z G d de      Zy)    )annotations)Any)"filter_out_none_values_recursivelyignore_docs)ApifyApiError)catch_not_found_or_throwpluck_data_as_list)ResourceClientResourceClientAsyncNc           	         | |||||||dS )N)cronExpression	isEnabledisExclusivenameactionsdescriptiontimezonetitle cron_expression
is_enabledis_exclusiver   r   r   r   r   s           x/home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/apify_client/clients/resource_clients/schedule.py_get_schedule_representationr      s&     *#"	 	    c            	           e Zd ZdZed	 fd       Zd
dZddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZddZ	 xZ
S )ScheduleClientz.Sub-client for manipulating a single schedule.c                L    |j                  dd      }t        |   |d|i| y)zInitialize the ScheduleClient.resource_path	schedulesNpopsuper__init__selfargskwargsr    	__class__s       r   r%   zScheduleClient.__init__%   ,     

?K@$FmFvFr   c                "    | j                         S )Return information about the schedule.

        https://docs.apify.com/api/v2#/reference/schedules/schedule-object/get-schedule

        Returns:
            dict, optional: The retrieved schedule
        _getr'   s    r   getzScheduleClient.get+   s     yy{r   Nr   c          
     \    t        ||||||||      }	| j                  t        |	            S )C  Update the schedule with specified fields.

        https://docs.apify.com/api/v2#/reference/schedules/schedule-object/update-schedule

        Args:
            cron_expression (str, optional): The cron expression used by this schedule
            is_enabled (bool, optional): True if the schedule should be enabled
            is_exclusive (bool, optional): 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): A human-friendly equivalent of the name

        Returns:
            dict: The updated schedule
        r   r   _updater   
r'   r   r   r   r   r   r   r   r   schedule_representations
             r   updatezScheduleClient.update5   s?    < #?+!%#	#
 ||>?VWXXr   c                $    | j                          yzyDelete the schedule.

        https://docs.apify.com/api/v2#/reference/schedules/schedule-object/delete-schedule
        N_deleter0   s    r   deletezScheduleClient.delete`   s    
 	r   c                    	 | j                   j                  | j                  d      d| j                               }t	        |j                               S # t        $ r}t        |       Y d}~yd}~ww xY wzReturn log for the given schedule.

        https://docs.apify.com/api/v2#/reference/schedules/schedule-log/get-schedule-log

        Returns:
            list, optional: Retrieved log of the given schedule
        logGET)urlmethodparamsNhttp_clientcall_url_paramsr	   jsonr   r   r'   responseexcs      r   get_logzScheduleClient.get_logg   sk    	*'',,IIe$||~ - H
 &hmmo66 	*$S))	*s   AA 	A4A//A4)r'   r   r(   r   r)   r   returnNone)r'   r   rO   dict | None)r'   r   r   
str | Noner   bool | Noner   rS   r   rR   r   list[dict] | Noner   rR   r   rR   r   rR   rO   dict)r'   r   rO   rP   )r'   r   rO   list | None__name__
__module____qualname____doc__r   r%   r1   r8   r=   rN   __classcell__r*   s   @r   r   r   "   s    8G G
 '+"&$(%)"&# )Y)Y $)Y  	)Y
 ")Y )Y #)Y  )Y )Y )Y 
)YVr   r   c            	           e Zd ZdZed	 fd       Zd
dZddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZddZ	 xZ
S )ScheduleClientAsyncz4Async sub-client for manipulating a single schedule.c                L    |j                  dd      }t        |   |d|i| y)z#Initialize the ScheduleClientAsync.r    r!   Nr"   r&   s       r   r%   zScheduleClientAsync.__init__   r+   r   c                >   K   | j                          d{   S 7 w)r-   Nr.   r0   s    r   r1   zScheduleClientAsync.get   s      YY[   s   Nr   c          
     x   K   t        ||||||||      }	| j                  t        |	             d{   S 7 w)r3   r   Nr4   r6   s
             r   r8   zScheduleClientAsync.update   sI     < #?+!%#	#
 \\"DE\"]^^^^s   1:8:c                @   K   | j                          d{    y7 wr:   r;   r0   s    r   r=   zScheduleClientAsync.delete   s     
 llns   c                
  K   	 | j                   j                  | j                  d      d| j                                d{   }t	        |j                               S 7 # t        $ r}t        |       Y d}~yd}~ww xY wwr?   rE   rK   s      r   rN   zScheduleClientAsync.get_log   sz     	*!--22IIe$||~ 3  H
 &hmmo66  	*$S))	*s@   B>A" A A" B A" "	B +A;6B;B  B)r'   r_   r(   r   r)   r   rO   rP   )r'   r_   rO   rQ   )r'   r_   r   rR   r   rS   r   rS   r   rR   r   rT   r   rR   r   rR   r   rR   rO   rU   )r'   r_   rO   rP   )r'   r_   rO   rV   rW   r]   s   @r   r_   r_   |   s    >G G
! '+"&$(%)"&# )_!)_ $)_  	)_
 ")_ )_ #)_  )_ )_ )_ 
)_Vr   r_   )NNNNNNNN)r   rR   r   rS   r   rS   r   rR   r   rT   r   rR   r   rR   r   rR   rO   rU   )
__future__r   typingr   apify_shared.utilsr   r   apify_client._errorsr   apify_client._utilsr   r	   apify_client.clients.baser
   r   r   r   r_   r   r   r   <module>rk      s    "  N . L I #'" $!%"  	
     
,W^ WtW- Wr   