
    i?1iH                    4   d dl mZ d dlmZ d dlmZmZ d dlmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 dZ6dZ7 G d d      Z8 G d	 d
e8      Z9 G d de8      Z:y)    )annotations)ignore_docs)
HTTPClientHTTPClientAsync).ActorClientActorClientAsyncActorCollectionClientActorCollectionClientAsyncBuildClientBuildClientAsyncBuildCollectionClientBuildCollectionClientAsyncDatasetClientDatasetClientAsyncDatasetCollectionClientDatasetCollectionClientAsyncKeyValueStoreClientKeyValueStoreClientAsyncKeyValueStoreCollectionClient"KeyValueStoreCollectionClientAsync	LogClientLogClientAsyncRequestQueueClientRequestQueueClientAsyncRequestQueueCollectionClient!RequestQueueCollectionClientAsync	RunClientRunClientAsyncRunCollectionClientRunCollectionClientAsyncScheduleClientScheduleClientAsyncScheduleCollectionClientScheduleCollectionClientAsyncStoreCollectionClientStoreCollectionClientAsync
TaskClientTaskClientAsyncTaskCollectionClientTaskCollectionClientAsync
UserClientUserClientAsyncWebhookClientWebhookClientAsyncWebhookCollectionClientWebhookCollectionClientAsyncWebhookDispatchClientWebhookDispatchClientAsyncWebhookDispatchCollectionClient$WebhookDispatchCollectionClientAsynczhttps://api.apify.comv2c                  \    e Zd ZU ded<   e	 d
ddddd	 	 	 	 	 	 	 	 	 	 	 	 	 dd       Zdd	Zy)_BaseApifyClientzHTTPClient | HTTPClientAsynchttp_clientN     h  api_urlmax_retries min_delay_between_retries_millistimeout_secsc                   || _         |xs t        j                  d      }| dt         | _        |xs d| _        |xs d| _        |xs d| _        y)a`  Initialize the Apify API Client.

        Args:
            token (str, optional): The Apify API token
            api_url (str, optional): The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com
            max_retries (int, optional): How many times to retry a failed request at most
            min_delay_between_retries_millis (int, optional): How long will the client wait between retrying requests
                (increases exponentially from this value)
            timeout_secs (int, optional): The socket timeout of the HTTP requests sent to the Apify API
        /r9   r:   r;   N)tokenDEFAULT_API_URLrstripAPI_VERSIONbase_urlr>   r?   r@   )selfrC   r=   r>   r?   r@   s         ]/home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/apify_client/client.py__init__z_BaseApifyClient.__init__>   sZ    ( 
-o55c:")1[M2&+!0P0WTW-(/C    c                6    | | j                   | j                  dS )N)root_clientrG   r8   )rG   r8   rH   s    rI   _optionsz_BaseApifyClient._optionsY   s    ++
 	
rK   N)rH   r7   rC   
str | Noner=   rQ   r>   
int | Noner?   rR   r@   rR   returnNone)rH   r7   rS   dict)__name__
__module____qualname____annotations__r   rJ   rO    rK   rI   r7   r7   ;   sy    -- !0 #"#7:#&000 	0
  0 +50 !0 
0 04
rK   r7   c                      e Zd ZU dZded<   	 d"ddddd	 	 	 	 	 	 	 	 	 	 	 	 	 d# fd	Zd$d
Zd%dZd&dZd'dZ	d(dZ
d)dZd*dZd+dZd,dZd-dZddd.dZd/dZd0dZd1dZd2dZd3dZd4dZd5dZd6dZd7dZd8dZd"d9d Zd:d!Z xZS );ApifyClientzThe Apify API client.r   r8   Nr9   r:   r;   r<   c                   t         |   |||||       t        || j                  | j                  | j
                        | _        y)a[  Initialize the ApifyClient.

        Args:
            token (str, optional): The Apify API token
            api_url (str, optional): The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com
            max_retries (int, optional): How many times to retry a failed request at most
            min_delay_between_retries_millis (int, optional): How long will the client wait between retrying requests
                (increases exponentially from this value)
            timeout_secs (int, optional): The socket timeout of the HTTP requests sent to the Apify API
        r<   rC   r>   r?   r@   N)superrJ   r   r>   r?   r@   r8   rH   rC   r=   r>   r?   r@   	__class__s         rI   rJ   zApifyClient.__init__f   sS    & 	#-M% 	 	
 &((-1-R-R**	
rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single actor.

        Args:
            actor_id (str): ID of the actor to be manipulated
        resource_idrZ   )r   rO   rH   actor_ids     rI   actorzApifyClient.actor        CxC4==?CCrK   c                4    t        di | j                         S z0Retrieve the sub-client for manipulating actors.rZ   )r	   rO   rN   s    rI   actorszApifyClient.actors       $7t}}77rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single actor build.

        Args:
            build_id (str): ID of the actor build to be manipulated
        rd   rZ   )r   rO   rH   build_ids     rI   buildzApifyClient.build   rh   rK   c                4    t        di | j                         S z?Retrieve the sub-client for querying multiple builds of a user.rZ   )r   rO   rN   s    rI   buildszApifyClient.builds   rl   rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single actor run.

        Args:
            run_id (str): ID of the actor run to be manipulated
        rd   rZ   )r   rO   rH   run_ids     rI   runzApifyClient.run   s     ?V?t}}??rK   c                4    t        di | j                         S zCRetrieve the sub-client for querying multiple actor runs of a user.rZ   )r   rO   rN   s    rI   runszApifyClient.runs   s    "5T]]_55rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single dataset.

        Args:
            dataset_id (str): ID of the dataset to be manipulated
        rd   rZ   )r   rO   rH   
dataset_ids     rI   datasetzApifyClient.dataset        GGt}}GGrK   c                4    t        di | j                         S z2Retrieve the sub-client for manipulating datasets.rZ   )r   rO   rN   s    rI   datasetszApifyClient.datasets       &999rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single key-value store.

        Args:
            key_value_store_id (str): ID of the key-value store to be manipulated
        rd   rZ   )r   rO   rH   key_value_store_ids     rI   key_value_storezApifyClient.key_value_store   s     #U/AUT]]_UUrK   c                4    t        di | j                         S z:Retrieve the sub-client for manipulating key-value stores.rZ   )r   rO   rN   s    rI   key_value_storeszApifyClient.key_value_stores       ,?t}}??rK   
client_keyc               :    t        d||d| j                         S a  Retrieve the sub-client for manipulating a single request queue.

        Args:
            request_queue_id (str): ID of the request queue to be manipulated
            client_key (str): A unique identifier of the client accessing the request queue
        )rd   r   rZ   )r   rO   rH   request_queue_idr   s      rI   request_queuezApifyClient.request_queue   s$     "i.>:iY]YfYfYhiirK   c                4    t        di | j                         S z8Retrieve the sub-client for manipulating request queues.rZ   )r   rO   rN   s    rI   request_queueszApifyClient.request_queues       +>dmmo>>rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single webhook.

        Args:
            webhook_id (str): ID of the webhook to be manipulated
        rd   rZ   )r-   rO   rH   
webhook_ids     rI   webhookzApifyClient.webhook   r   rK   c                4    t        di | j                         S zARetrieve the sub-client for querying multiple webhooks of a user.rZ   )r/   rO   rN   s    rI   webhookszApifyClient.webhooks   r   rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for accessing a single webhook dispatch.

        Args:
            webhook_dispatch_id (str): ID of the webhook dispatch to access
        rd   rZ   )r1   rO   rH   webhook_dispatch_ids     rI   webhook_dispatchzApifyClient.webhook_dispatch   s     %X1DXXXrK   c                4    t        di | j                         S zKRetrieve the sub-client for querying multiple webhook dispatches of a user.rZ   )r3   rO   rN   s    rI   webhook_dispatcheszApifyClient.webhook_dispatches   s    .AAArK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single schedule.

        Args:
            schedule_id (str): ID of the schedule to be manipulated
        rd   rZ   )r!   rO   rH   schedule_ids     rI   schedulezApifyClient.schedule   s     I+IIIrK   c                4    t        di | j                         S z3Retrieve the sub-client for manipulating schedules.rZ   )r#   rO   rN   s    rI   	scheduleszApifyClient.schedules       ':$--/::rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for retrieving logs.

        Args:
            build_or_run_id (str): ID of the actor build or run for which to access the log
        rd   rZ   )r   rO   rH   build_or_run_ids     rI   logzApifyClient.log   s     H_HHHrK   c                8    t        dd|i| j                         S zRetrieve the sub-client for manipulating a single task.

        Args:
            task_id (str): ID of the task to be manipulated
        rd   rZ   )r'   rO   rH   task_ids     rI   taskzApifyClient.task        AgAAArK   c                4    t        di | j                         S z/Retrieve the sub-client for manipulating tasks.rZ   )r)   rO   rN   s    rI   taskszApifyClient.tasks  s    #6dmmo66rK   c                8    t        dd|i| j                         S zRetrieve the sub-client for querying users.

        Args:
            user_id (str, optional): ID of user to be queried. If None, queries the user belonging to the token supplied to the client
        rd   rZ   )r+   rO   rH   user_ids     rI   userzApifyClient.user	  r   rK   c                4    t        di | j                         S z(Retrieve the sub-client for Apify store.rZ   )r%   rO   rN   s    rI   storezApifyClient.store  rl   rK   rP   )rH   r\   rC   rQ   r=   rQ   r>   rR   r?   rR   r@   rR   rS   rT   )rH   r\   rf   strrS   r   )rH   r\   rS   r	   )rH   r\   rp   r   rS   r   )rH   r\   rS   r   )rH   r\   rx   r   rS   r   )rH   r\   rS   r   )rH   r\   r   r   rS   r   )rH   r\   rS   r   )rH   r\   r   r   rS   r   )rH   r\   rS   r   )rH   r\   r   r   r   rQ   rS   r   )rH   r\   rS   r   )rH   r\   r   r   rS   r-   )rH   r\   rS   r/   )rH   r\   r   r   rS   r1   )rH   r\   rS   r3   )rH   r\   r   r   rS   r!   )rH   r\   rS   r#   )rH   r\   r   r   rS   r   )rH   r\   r   r   rS   r'   )rH   r\   rS   r)   )rH   r\   r   rQ   rS   r+   )rH   r\   rS   r%   rV   rW   rX   __doc__rY   rJ   rg   rk   rq   rt   ry   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __classcell__ra   s   @rI   r\   r\   a   s     ! 
 #"#7:#& 
 
 
 	 

   
 +5 
 ! 
 
 
DD8D8@6H:V@ ]a j?H:YBJ;IB7B8rK   r\   c                      e Zd ZU dZded<   	 d"ddddd	 	 	 	 	 	 	 	 	 	 	 	 	 d# fd	Zd$d
Zd%dZd&dZd'dZ	d(dZ
d)dZd*dZd+dZd,dZd-dZddd.dZd/dZd0dZd1dZd2dZd3dZd4dZd5dZd6dZd7dZd8dZd"d9d Zd:d!Z xZS );ApifyClientAsyncz1The asynchronous version of the Apify API client.r   r8   Nr9   r:   r;   r<   c                   t         |   |||||       t        || j                  | j                  | j
                        | _        y)a`  Initialize the ApifyClientAsync.

        Args:
            token (str, optional): The Apify API token
            api_url (str, optional): The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com
            max_retries (int, optional): How many times to retry a failed request at most
            min_delay_between_retries_millis (int, optional): How long will the client wait between retrying requests
                (increases exponentially from this value)
            timeout_secs (int, optional): The socket timeout of the HTTP requests sent to the Apify API
        r<   r^   N)r_   rJ   r   r>   r?   r@   r8   r`   s         rI   rJ   zApifyClientAsync.__init__  sS    & 	#-M% 	 	
 +((-1-R-R**	
rK   c                8    t        dd|i| j                         S rc   )r   rO   re   s     rI   rg   zApifyClientAsync.actor=        HHHHHrK   c                4    t        di | j                         S rj   )r
   rO   rN   s    rI   rk   zApifyClientAsync.actorsE      )<DMMO<<rK   c                8    t        dd|i| j                         S rn   )r   rO   ro   s     rI   rq   zApifyClientAsync.buildI  r   rK   c                4    t        di | j                         S rs   )r   rO   rN   s    rI   rt   zApifyClientAsync.buildsQ  r   rK   c                8    t        dd|i| j                         S rv   )r   rO   rw   s     rI   ry   zApifyClientAsync.runU  s     D&DDMMODDrK   c                4    t        di | j                         S r{   )r    rO   rN   s    rI   r|   zApifyClientAsync.runs]  r   rK   c                8    t        dd|i| j                         S r~   )r   rO   r   s     rI   r   zApifyClientAsync.dataseta       "LjLDMMOLLrK   c                4    t        di | j                         S r   )r   rO   rN   s    rI   r   zApifyClientAsync.datasetsi  r   rK   c                8    t        dd|i| j                         S r   )r   rO   r   s     rI   r   z ApifyClientAsync.key_value_storem  s     (Z4FZ$--/ZZrK   c                4    t        di | j                         S r   )r   rO   rN   s    rI   r   z!ApifyClientAsync.key_value_storesu  s    1DDMMODDrK   r   c               :    t        d||d| j                         S r   )r   rO   r   s      rI   r   zApifyClientAsync.request_queuey  s%     'n3CPZn^b^k^k^mnnrK   c                4    t        di | j                         S r   )r   rO   rN   s    rI   r   zApifyClientAsync.request_queues  s    0C4==?CCrK   c                8    t        dd|i| j                         S r   )r.   rO   r   s     rI   r   zApifyClientAsync.webhook  r   rK   c                4    t        di | j                         S r   )r0   rO   rN   s    rI   r   zApifyClientAsync.webhooks  r   rK   c                8    t        dd|i| j                         S r   )r2   rO   r   s     rI   r   z!ApifyClientAsync.webhook_dispatch  s     *]6I]T]]_]]rK   c                4    t        di | j                         S r   )r4   rO   rN   s    rI   r   z#ApifyClientAsync.webhook_dispatches  s    3FdmmoFFrK   c                8    t        dd|i| j                         S r   )r"   rO   r   s     rI   r   zApifyClientAsync.schedule  s     #N{NdmmoNNrK   c                4    t        di | j                         S r   )r$   rO   rN   s    rI   r   zApifyClientAsync.schedules  r   rK   c                8    t        dd|i| j                         S r   )r   rO   r   s     rI   r   zApifyClientAsync.log  s     M/MT]]_MMrK   c                8    t        dd|i| j                         S r   )r(   rO   r   s     rI   r   zApifyClientAsync.task       F7FdmmoFFrK   c                4    t        di | j                         S r   )r*   rO   rN   s    rI   r   zApifyClientAsync.tasks  s    (;4==?;;rK   c                8    t        dd|i| j                         S r   )r,   rO   r   s     rI   r   zApifyClientAsync.user  r   rK   c                4    t        di | j                         S r   )r&   rO   rN   s    rI   r   zApifyClientAsync.store  r   rK   rP   )rH   r   rC   rQ   r=   rQ   r>   rR   r?   rR   r@   rR   rS   rT   )rH   r   rf   r   rS   r   )rH   r   rS   r
   )rH   r   rp   r   rS   r   )rH   r   rS   r   )rH   r   rx   r   rS   r   )rH   r   rS   r    )rH   r   r   r   rS   r   )rH   r   rS   r   )rH   r   r   r   rS   r   )rH   r   rS   r   )rH   r   r   r   r   rQ   rS   r   )rH   r   rS   r   )rH   r   r   r   rS   r.   )rH   r   rS   r0   )rH   r   r   r   rS   r2   )rH   r   rS   r4   )rH   r   r   r   rS   r"   )rH   r   rS   r$   )rH   r   r   r   rS   r   )rH   r   r   r   rS   r(   )rH   r   rS   r*   )rH   r   r   rQ   rS   r,   )rH   r   rS   r&   r   r   s   @rI   r   r     s    ;   ! 
 #"#7:#& 
 
 
 	 

   
 +5 
 ! 
 
 
DI=I=E;M?[E bf oDM?^GO@NG<G=rK   r   N);
__future__r   apify_shared.utilsr   apify_client._http_clientr   r   apify_client.clientsr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   rD   rF   r7   r\   r   rZ   rK   rI   <module>r      s    " * A/ / / / / / / / / / / /b *#
 #
Lr8" r8jr=' r=rK   