
    b6i4                         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 ddlmZ  G d d      Z G d d      Zy)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)jsonable_encoder)RequestOptions)construct_type)UnprocessableEntityError)DeleteSampleResponse)HttpValidationErrorc            
       V    e Zd ZdefdZdddededej                  e   de	e
   fd	Zy)
RawSamplesClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     h/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/samples/raw_client.py__init__zRawSamplesClient.__init__   
    -    Nrequest_optionsvoice_id	sample_idr   returnc                   | j                   j                  j                  dt        |       dt        |       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  
        Removes a sample by its ID.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.

        sample_id : str
            ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.

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

        Returns
        -------
        HttpResponse[DeleteSampleResponse]
            Successful Response
        
v1/voices/	/samples/DELETEmethodr      ,  type_object_responsedata  headersbodystatus_coder2   r3   )r   httpx_clientrequestr
   r5   typingcastr   r   jsonr	   r   dictr2   r   r   r   textr   r   r    r   	_response_data_response_jsons          r   deletezRawSamplesClient.delete   sO   , ((55==)(34I>Ny>Y=Z[+ > 
	
	ti++1c1("2 ) 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   strr8   Optionalr   r	   r   rA    r   r   r   r      sP    .*; . dh3p3p(+3pAGQ_A`3p	*	+3pr   r   c            
       V    e Zd ZdefdZdddededej                  e   de	e
   fd	Zy)
AsyncRawSamplesClientr   c                    || _         y r   r   r   s     r   r   zAsyncRawSamplesClient.__init__L   r   r   Nr   r   r    r   r!   c                  K   | j                   j                  j                  dt        |       dt        |       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  
        Removes a sample by its ID.

        Parameters
        ----------
        voice_id : str
            ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.

        sample_id : str
            ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.

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

        Returns
        -------
        AsyncHttpResponse[DeleteSampleResponse]
            Successful Response
        r#   r$   r%   r&   Nr(   r)   r*   r-   r0   r1   r4   )r   r6   r7   r
   r5   r8   r9   r   r   r:   r   r   r;   r2   r   r   r   r<   r=   s          r   rA   zAsyncRawSamplesClient.deleteO   s]    , ..;;CC)(34I>Ny>Y=Z[+ D 
 
	
	ti++1c1("2 ) 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s8   AFEFAE
 'F(A4E
 ,F
?F		F)rB   rC   rD   r   r   rE   r8   rF   r   r   r   rA   rG   r   r   rI   rI   K   sP    .*< . dh3p3p(+3pAGQ_A`3p	/	03pr   rI   )r8   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.jsonable_encoderr
   core.request_optionsr   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   types.delete_sample_responser   types.http_validation_errorr   r   rI   rG   r   r   <module>rV      sA     ( % G @ 4 1 6 H ? =7p 7pt7p 7pr   