
    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_task_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
dZ xZS )TaskCollectionClientz"Sub-client for manipulating tasks.c                L    |j                  dd      }t        |   |d|i| y)z$Initialize the TaskCollectionClient.resource_pathactor-tasksNpopsuper__init__selfargskwargsr   	__class__s       /home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/apify_client/clients/resource_clients/task_collection.pyr   zTaskCollectionClient.__init__   ,     

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

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

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

        Returns:
            ListPage: The list of available tasks matching the specified filters.
        r   _listr   r   r   r    s       r   listzTaskCollectionClient.list   s    & zzf4z@@r   buildtimeout_secsmemory_mbytes	max_items
task_inputtitlec          
     \    t        ||||||||      }	| j                  t        |	            S )  Create a new task.

        https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/create-task

        Args:
            actor_id (str): Id of the actor that should be run
            name (str): Name of the task
            build (str, optional): Actor build to run. It can be either a build tag or build number.
                                   By default, the run uses the build specified in the task settings (typically latest).
            memory_mbytes (int, optional): Memory limit for the run, in megabytes.
                                           By default, the run uses a memory limit specified in the task settings.
            max_items (int, optional): Maximum number of results that will be returned by runs of this task.
                                       If the Actor of this task is charged per result, you will not be charged for more results than the given limit.
            timeout_secs (int, optional): Optional timeout for the run, in seconds. By default, the run uses timeout specified in the task settings.
            task_input (dict, optional): Task input object.
            title (str, optional): A human-friendly equivalent of the name

        Returns:
            dict: The created task.
        actor_idnamer,   r(   r+   r*   r)   r-   r
   _creater   
r   r1   r2   r(   r)   r*   r+   r,   r-   task_representations
             r   createzTaskCollectionClient.create,   s@    @ 6!'%	
 ||>?RSTTr   )r   r   r   r   r   r   returnNone)
r   r   r   
int | Noner   r:   r    bool | Noner8   ListPage[dict])r   r   r1   strr2   r=   r(   
str | Noner)   r:   r*   r:   r+   r:   r,   dict | Noner-   r>   r8   dict	__name__
__module____qualname____doc__r   r   r&   r7   __classcell__r   s   @r   r   r      s    ,G G !! A"A A 	A
 A 
A4 !#'$( $"& +U"+U +U 	+U
 +U !+U "+U +U  +U +U 
+U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
dZ xZS )TaskCollectionClientAsyncz(Async sub-client for manipulating tasks.c                L    |j                  dd      }t        |   |d|i| y)z)Initialize the TaskCollectionClientAsync.r   r   Nr   r   s       r   r   z"TaskCollectionClientAsync.__init__]   r   r   Nr   c               F   K   | j                  |||       d{   S 7 w)r"   r   Nr#   r%   s       r   r&   zTaskCollectionClientAsync.listc   s#     & ZZeFZFFFFs   !!r'   c          
     x   K   t        ||||||||      }	| j                  t        |	             d{   S 7 w)r/   r0   Nr3   r5   s
             r   r7   z TaskCollectionClientAsync.createx   sJ     @ 6!'%	
 \\"DEX"YZZZZs   1:8:)r   rI   r   r   r   r   r8   r9   )
r   rI   r   r:   r   r:   r    r;   r8   r<   )r   rI   r1   r=   r2   r=   r(   r>   r)   r:   r*   r:   r+   r:   r,   r?   r-   r>   r8   r@   rA   rG   s   @r   rI   rI   Z   s    2G G !! G'G G 	G
 G 
G4 !#'$( $"& +['+[ +[ 	+[
 +[ !+[ "+[ +[  +[ +[ 
+[r   rI   N)
__future__r   typingr   r   apify_shared.utilsr   r   apify_client.clients.baser   r	   *apify_client.clients.resource_clients.taskr
   apify_shared.modelsr   r   rI    r   r   <module>rT      s=    " % N ] N,IU3 IUXI[ = I[r   