
    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  G d de      Z G d	 d
e      Zy)    )annotations)Any)ignore_docsparse_date_fields)ApifyApiError)catch_not_found_or_throw
pluck_data)ResourceClientResourceClientAsyncc                  F     e Zd ZdZed fd       ZddZddZddZ xZ	S )
UserClientz"Sub-client for querying user data.c                z    |j                  dd      }|d}|j                  dd      }t        |   |||d| y)zInitialize the UserClient.resource_idNmeresource_pathusersr   r   popsuper__init__selfargskwargsr   r   	__class__s        t/home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/apify_client/clients/resource_clients/user.pyr   zUserClient.__init__   G     jj5K

?G<$K}_X^_    c                "    | j                         S )  Return information about user account.

        You receive all or only public info based on your token permissions.

        https://docs.apify.com/api/v2#/reference/users

        Returns:
            The retrieved user data, or None if the user does not exist.
        _getr   s    r   getzUserClient.get   s     yy{r   c                    	 | j                   j                  | j                  d      d| j                               }t	        t        |j                                     S # t        $ r}t        |       Y d}~yd}~ww xY wa  Return monthly usage of the user account.

        This includes a complete usage summary for the current usage cycle, an overall sum, as well as a daily breakdown
        of usage. It is the same information which is available on the account's Billing page. The information includes
        use of storage, data transfer, and request queue usage.

        https://docs.apify.com/api/v2/#/reference/users/monthly-usage

        Returns:
            The retrieved request, or None, if it did not exist.
        zusage/monthlyGETurlmethodparamsN	http_clientcall_url_paramsr   r	   jsonr   r   r   responseexcs      r   monthly_usagezUserClient.monthly_usage$   sp    		*'',,IIo.||~ - H
 %Z%@AA 	*$S))	*   AA 	A=(A88A=c                    	 | j                   j                  | j                  d      d| j                               }t	        t        |j                                     S # t        $ r}t        |       Y d}~yd}~ww xY wa  Returns a complete summary of the user account's limits.

        It is the same information which is available on the account's Limits page. The returned data includes the current
        usage cycle, a summary of the account's limits, and the current usage.

        https://docs.apify.com/api/v2#/reference/request-queues/request/get-request

        Returns:
            The retrieved request, or None, if it did not exist.
        limitsr(   r)   Nr-   r3   s      r   r:   zUserClient.limits=   sp    		*'',,IIh'||~ - H
 %Z%@AA 	*$S))	*r7   )r   r   r   r   r   r   returnNone)r   r   r;   dict | None
__name__
__module____qualname____doc__r   r   r%   r6   r:   __classcell__r   s   @r   r   r      s)    ,` `
2r   r   c                  F     e Zd ZdZed fd       ZddZddZddZ xZ	S )UserClientAsyncz(Async sub-client for querying user data.c                z    |j                  dd      }|d}|j                  dd      }t        |   |||d| y)zInitialize the UserClientAsync.r   Nr   r   r   r   r   r   s        r   r   zUserClientAsync.__init__Y   r   r   c                >   K   | j                          d{   S 7 w)r!   Nr"   r$   s    r   r%   zUserClientAsync.getb   s      YY[   s   c                  K   	 | j                   j                  | j                  d      d| j                                d{   }t	        t        |j                                     S 7 &# t        $ r}t        |       Y d}~yd}~ww xY wwr'   r-   r3   s      r   r6   zUserClientAsync.monthly_usagen   s     		*!--22IIo.||~ 3  H
 %Z%@AA  	*$S))	*@   B>A+ A)%A+ (B)A+ +	B	4B?BB		Bc                  K   	 | j                   j                  | j                  d      d| j                                d{   }t	        t        |j                                     S 7 &# t        $ r}t        |       Y d}~yd}~ww xY wwr9   r-   r3   s      r   r:   zUserClientAsync.limits   s     		*!--22IIh'||~ 3  H
 %Z%@AA  	*$S))	*rJ   )r   rF   r   r   r   r   r;   r<   )r   rF   r;   r=   r>   rD   s   @r   rF   rF   V   s)    2` `
!2r   rF   N)
__future__r   typingr   apify_shared.utilsr   r   apify_client._errorsr   apify_client._utilsr   r	   apify_client.clients.baser
   r   r   rF    r   r   <module>rS      s5    "  = . D IG GTG) Gr   