o
    lWi                     @   sz   d dl Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ e e jd	ZG d
d dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions))PronunciationDictionaryRulesResponseModel   )AsyncRawRulesClientRawRulesClient)PronunciationDictionaryRule.c                	   @      e Zd ZdefddZedefddZddd	ed
e	j
e de	je defddZddd	ede	j
e de	je defddZdS )RulesClientclient_wrapperc                C      t |d| _d S N)r   )r	   _raw_clientselfr    r   v/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/pronunciation_dictionaries/rules/client.py__init__      zRulesClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawRulesClient
        r   r   r   r   r   with_raw_response      	zRulesClient.with_raw_responseNrequest_optionspronunciation_dictionary_idrulesr   c                C      | j j|||d}|jS )a7  
        Add rules to the pronunciation dictionary

        Parameters
        ----------
        pronunciation_dictionary_id : str
            The id of the pronunciation dictionary

        rules : typing.Sequence[PronunciationDictionaryRule]
            List of pronunciation rules. Rule can be either:
                an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', }
                or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' }

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

        Returns
        -------
        PronunciationDictionaryRulesResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs
        from elevenlabs.pronunciation_dictionaries.rules import (
            PronunciationDictionaryRule_Alias,
        )

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.pronunciation_dictionaries.rules.add(
            pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM",
            rules=[
                PronunciationDictionaryRule_Alias(
                    string_to_replace="Thailand",
                    alias="tie-land",
                )
            ],
        )
        r    r   r   adddatar   r   r    r   	_responser   r   r   r$      s   0zRulesClient.addrule_stringsc                C   r!   )aZ  
        Remove rules from the pronunciation dictionary

        Parameters
        ----------
        pronunciation_dictionary_id : str
            The id of the pronunciation dictionary

        rule_strings : typing.Sequence[str]
            List of strings to remove from the pronunciation dictionary.

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

        Returns
        -------
        PronunciationDictionaryRulesResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.pronunciation_dictionaries.rules.remove(
            pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM",
            rule_strings=["rule_strings"],
        )
        r(   r   r   remover%   r   r   r(   r   r'   r   r   r   r+   Q   s   &zRulesClient.remove)__name__
__module____qualname__r   r   propertyr	   r   strtypingSequencer
   Optionalr   r   r$   r+   r   r   r   r   r      s0    
8r   c                	   @   r   )AsyncRulesClientr   c                C   r   r   )r   r   r   r   r   r   r   ~   r   zAsyncRulesClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawRulesClient
        r   r   r   r   r   r      r   z"AsyncRulesClient.with_raw_responseNr   r   r    r   c                       | j j|||dI dH }|jS )a  
        Add rules to the pronunciation dictionary

        Parameters
        ----------
        pronunciation_dictionary_id : str
            The id of the pronunciation dictionary

        rules : typing.Sequence[PronunciationDictionaryRule]
            List of pronunciation rules. Rule can be either:
                an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', }
                or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' }

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

        Returns
        -------
        PronunciationDictionaryRulesResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs
        from elevenlabs.pronunciation_dictionaries.rules import (
            PronunciationDictionaryRule_Alias,
        )

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.pronunciation_dictionaries.rules.add(
                pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM",
                rules=[
                    PronunciationDictionaryRule_Alias(
                        string_to_replace="Thailand",
                        alias="tie-land",
                    )
                ],
            )


        asyncio.run(main())
        r"   Nr#   r&   r   r   r   r$      s
   8zAsyncRulesClient.addr(   c                   r6   )a  
        Remove rules from the pronunciation dictionary

        Parameters
        ----------
        pronunciation_dictionary_id : str
            The id of the pronunciation dictionary

        rule_strings : typing.Sequence[str]
            List of strings to remove from the pronunciation dictionary.

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

        Returns
        -------
        PronunciationDictionaryRulesResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.pronunciation_dictionaries.rules.remove(
                pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM",
                rule_strings=["rule_strings"],
            )


        asyncio.run(main())
        r)   Nr*   r,   r   r   r   r+      s
   .zAsyncRulesClient.remove)r-   r.   r/   r   r   r0   r   r   r1   r2   r3   r
   r4   r   r   r$   r+   r   r   r   r   r5   }   s0    
Br5   )r2   core.client_wrapperr   r   core.request_optionsr   3types.pronunciation_dictionary_rules_response_modelr   
raw_clientr   r	   #types.pronunciation_dictionary_ruler
   castAnyOMITr   r5   r   r   r   r   <module>   s   n