
    b6i                         d dl Z d dlmZ ddlmZ ddlmZmZ ddlm	Z	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)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)RequestOptions)construct_type)UnprocessableEntityError)HttpValidationError)Userc                   N    e Zd ZdefdZdddej                  e   dee	   fdZ
y)RawUserClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     e/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/user/raw_client.py__init__zRawUserClient.__init__   
    -    Nrequest_optionsr   returnc                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                  dk(  rUt        t        |j                        t	        j
                  t        t        t        |j                                     	      |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                   
      w xY w)a  
        Gets information about the user

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

        Returns
        -------
        HttpResponse[User]
            Successful Response
        v1/userGETmethodr      ,  type_object_responsedata  headersbodystatus_coder.   r/   )r   httpx_clientrequestr1   typingcastr   r   jsonr	   r   dictr.   r   r   r   textr   r   	_response_data_response_jsons        r   getzRawUserClient.get   s4    ((55==+ > 
	
	ti++1c1"" ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AD% A4D% %?E$)__name__
__module____qualname__r   r   r4   Optionalr
   r	   r   r=    r   r   r   r      s<    .*; . IM +pfoon&E +pQ]^bQc +pr   r   c                   N    e Zd ZdefdZdddej                  e   dee	   fdZ
y)AsyncRawUserClientr   c                    || _         y r   r   r   s     r   r   zAsyncRawUserClient.__init__C   r   r   Nr   r   r   c                  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                  d	k(  rUt        t        |j                        t	        j
                  t        t        t        |j                                     
      |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                         w xY ww)a  
        Gets information about the user

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

        Returns
        -------
        AsyncHttpResponse[User]
            Successful Response
        r    r!   r"   Nr$   r%   r&   r)   r,   r-   r0   )r   r2   r3   r1   r4   r5   r   r   r6   r   r   r7   r.   r   r   r   r8   r9   s        r   r=   zAsyncRawUserClient.getF   sB     ..;;CC+ D 
 
	
	ti++1c1"" ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo;
6  	ty'<'<d9K\K\F]dmdrdrss	ts4   ,E4D/E4AD2 E4A4D2 ,E42?E11E4)r>   r?   r@   r   r   r4   rA   r
   r   r   r=   rB   r   r   rD   rD   B   s<    .*< . OS +pFOON,K +pWhimWn +pr   rD   )r4   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.request_optionsr
   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   types.http_validation_errorr   
types.userr   r   rD   rB   r   r   <module>rP      s>     ( % G @ 1 6 H = /p /pd/p /pr   