
    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
 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)ListPagec                  h     e Zd ZdZed fd       Zddddd	 	 	 	 	 	 	 	 	 	 	 d	dZdddd
dZ xZS )DatasetCollectionClientz%Sub-client for manipulating datasets.c                L    |j                  dd      }t        |   |d|i| y)zAInitialize the DatasetCollectionClient with the passed arguments.resource_pathdatasetsNpopsuper__init__selfargskwargsr   	__class__s       /home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/apify_client/clients/resource_clients/dataset_collection.pyr   z DatasetCollectionClient.__init__   ,     

?J?$FmFvF    Nunnamedlimitoffsetdescc               ,    | j                  ||||      S )h  List the available datasets.

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

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

        Returns:
            ListPage: The list of available datasets matching the specified filters.
        r   _listr   r   r   r   r    s        r   listzDatasetCollectionClient.list   s    * zz'vDzQQr   nameschemac               >    | j                  |t        d|i            S )  Retrieve a named dataset, or create a new one when it doesn't exist.

        https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/create-dataset

        Args:
            name (str, optional): The name of the dataset to retrieve or create.
            schema (dict, optional): The schema of the dataset

        Returns:
            dict: The retrieved or newly-created dataset.
        r)   r(   resource_get_or_creater   r   r(   r)   s      r   get_or_createz%DatasetCollectionClient.get_or_create-   s'     ""7Y[cekZl7m"nnr   )r   r   r   r   r   r   returnNone)r   r   r   bool | Noner   
int | Noner   r5   r    r4   r2   ListPage[dict])r   r   r(   
str | Noner)   dict | Noner2   dict	__name__
__module____qualname____doc__r   r   r&   r1   __classcell__r   s   @r   r   r      s    /G G  $ ! R%R R 	R
 R R 
R. LPgk o or   r   c                  v     e Zd ZdZed fd       Zddddd	 	 	 	 	 	 	 	 	 	 	 d	dZddd	 	 	 	 	 	 	 d
dZ xZS )DatasetCollectionClientAsyncz+Async sub-client for manipulating datasets.c                L    |j                  dd      }t        |   |d|i| y)zFInitialize the DatasetCollectionClientAsync with the passed arguments.r   r   Nr   r   s       r   r   z%DatasetCollectionClientAsync.__init__?   r   r   Nr   c               H   K   | j                  ||||       d{   S 7 w)r"   r   Nr#   r%   s        r   r&   z!DatasetCollectionClientAsync.listE   s&     * ZZuVRVZWWWWs   " "r'   c               Z   K   | j                  |t        d|i             d{   S 7 w)r+   r)   r,   Nr.   r0   s      r   r1   z*DatasetCollectionClientAsync.get_or_create\   s1     " ((d=_aikq`r=s(tttts   "+)+)r   rB   r   r   r   r   r2   r3   )r   rB   r   r4   r   r5   r   r5   r    r4   r2   r6   )r   rB   r(   r7   r)   r8   r2   r9   r:   r@   s   @r   rB   rB   <   s    5G G  $ ! X*X X 	X
 X X 
X4  "	u*u u 	u
 
ur   rB   N)
__future__r   typingr   r   apify_shared.utilsr   r   apify_client.clients.baser   r	   apify_shared.modelsr
   r   rB    r   r   <module>rL      s6    " % N ],,o6 ,o^1u#@ 1ur   