
    b6i2                         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 j                  e j                  d	      Z G d
 d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions))PronunciationDictionaryRulesResponseModel   )AsyncRawRulesClientRawRulesClient)PronunciationDictionaryRule.c            	           e Zd ZdefdZedefd       Zdddede	j                  e   d	e	j                  e   defd
Zdddede	j                  e   d	e	j                  e   defdZy)RulesClientclient_wrapperc                &    t        |      | _        y N)r   )r
   _raw_clientselfr   s     }/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/pronunciation_dictionaries/rules/client.py__init__zRulesClient.__init__   s    )H    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawRulesClient
        r   r   s    r   with_raw_responsezRulesClient.with_raw_response        r   Nrequest_optionspronunciation_dictionary_idrulesr   c                V    | j                   j                  |||      }|j                  S )a  
        Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced.

        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   	_responses        r   r$   zRulesClient.add   s.    ` $$(()DEcr(s	~~r   rule_stringsc                V    | j                   j                  |||      }|j                  S )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'   s        r   r,   zRulesClient.removeQ   s4    L $$++'lTc , 
	 ~~r   )__name__
__module____qualname__r   r   propertyr
   r   strtypingSequencer   Optionalr   r   r$   r,    r   r   r   r      s    I*; I  >     <@1%(1 :;	1
  81 
31p <@)%() ooc*	)
  8) 
3)r   r   c            	           e Zd ZdefdZedefd       Zdddede	j                  e   d	e	j                  e   defd
Zdddede	j                  e   d	e	j                  e   defdZy)AsyncRulesClientr   c                &    t        |      | _        y r   )r	   r   r   s     r   r   zAsyncRulesClient.__init__~   s    .nMr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawRulesClient
        r   r   s    r   r   z"AsyncRulesClient.with_raw_response   r   r   Nr   r   r    r   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced.

        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&   s        r   r$   zAsyncRulesClient.add   sA     p **..'uo / 
 
	 ~~
   "757r(   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)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-   s        r   r,   zAsyncRulesClient.remove   sB     \ **11'lTc 2 
 
	 ~~
r<   )r.   r/   r0   r   r   r1   r	   r   r2   r3   r4   r   r5   r   r   r$   r,   r6   r   r   r8   r8   }   s    N*< N  #6     <@;%(; :;	;
  8; 
3;D <@1%(1 ooc*	1
  81 
31r   r8   )r3   core.client_wrapperr   r   core.request_optionsr   3types.pronunciation_dictionary_rules_response_modelr   
raw_clientr	   r
   #types.pronunciation_dictionary_ruler   castAnyOMITr   r8   r6   r   r   <module>rF      sJ     H 2 l ; L v{{6::s#k k\} }r   