
    >|h                         d dl mZ ddlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ dd	lmZ d d
lmZ d dlmZ d dl mZ  G d d      Z G d d      Zy)   )SyncClientWrapper    N)RequestOptions)Subscription)construct_type)UnprocessableEntityError)HttpValidationError)JSONDecodeError)ApiError)User)AsyncClientWrapperc                   x    e Zd ZdefdZdddej                  e   defdZ	dddej                  e   de
fdZy)	
UserClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     U/var/www/html/test/engine/venv/lib/python3.12/site-packages/elevenlabs/user/client.py__init__zUserClient.__init__   
    -    Nrequest_optionsr   returnc          
      :   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)	a  
        Gets extended information about the users subscription

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Subscription
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.user.get_subscription()
        v1/user/subscriptionGETmethodr      ,  type_object_  status_codebodyr   httpx_clientrequestr*   typingcastr   r   jsonr   r	   r
   r   textr   r   	_response_response_jsons       r   get_subscriptionzUserClient.get_subscription   s    . ((55=="+ > 
	
	Si++1c1{{ "* ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   AC/ 9AC/ /+Dc          
      :   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |      # t        $ r" t        |j                  |j                        w xY w)	a  
        Gets information about the user

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        User
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.user.get()
        v1/userr    r!   r#   r$   r%   r(   r)   r   r-   r.   r*   r/   r0   r   r   r1   r   r	   r
   r   r2   r3   s       r   getzUserClient.getH   s    . ((55==+ > 
	
	Si++1c1{{"" ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr7   )__name__
__module____qualname__r   r   r/   Optionalr   r   r6   r   r;    r   r   r   r      s^    .*; . VZ 2O6??>3R 2O^j 2Oh IM 2Ofoon&E 2OQU 2Or   r   c                   x    e Zd ZdefdZdddej                  e   defdZ	dddej                  e   de
fdZy)	AsyncUserClientr   c                    || _         y r   r   r   s     r   r   zAsyncUserClient.__init__~   r   r   Nr   r   r   c          
      V  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |	      7 # t        $ r" t        |j                  |j                  	      w xY ww)
aY  
        Gets extended information about the users subscription

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Subscription
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.user.get_subscription()


        asyncio.run(main())
        r   r    r!   Nr#   r$   r%   r(   r)   r,   r3   s       r   r6   z AsyncUserClient.get_subscription   s    > ..;;CC"+ D 
 
	
	Si++1c1{{ "* ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	S4   ,D)C9D)AC; D)AC; "D);+D&&D)c          
      V  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  r:n n7t	        j
                  t        t        t        |j                                     S |j                  dk(  r@t        t	        j
                  t        t        t        |j                                           |j                         }t        |j                  |	      7 # t        $ r" t        |j                  |j                  	      w xY ww)
a-  
        Gets information about the user

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        User
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.user.get()


        asyncio.run(main())
        r9   r    r!   Nr#   r$   r%   r(   r)   r:   r3   s       r   r;   zAsyncUserClient.get   s    > ..;;CC+ D 
 
	
	Si++1c1{{"" ) 0  $$+.KK+&"5$-NN$4  '^^-N 9#8#8~NN7
2  	Sy'<'<9>>RR	SrE   )r<   r=   r>   r   r   r/   r?   r   r   r6   r   r;   r@   r   r   rB   rB   }   s^    .*< . \` :O9X :Odp :Ox OS :OFOON,K :OW[ :Or   rB   )core.client_wrapperr   r/   core.request_optionsr   types.subscriptionr   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   types.http_validation_errorr	   json.decoderr
   core.api_errorr   
types.userr   r   r   rB   r@   r   r   <module>rP      sE    4  1 - 6 H = ( %  4jO jOZzO zOr   