o
    lWi6                     @   s   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	 ddl
mZmZ dd	l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) WorkspaceApiKeyListResponseModel)"WorkspaceCreateApiKeyResponseModel   )AsyncRawApiKeysClientRawApiKeysClient)YBodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions)`BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions.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fddZeddd	ededede	j
e d
e	j
e defddZddd	eded
e	j
e de	jfddZeddd	ededededede	j
e d
e	j
e de	jfddZdS )ApiKeysClientclient_wrapperc                C      t |d| _d S N)r   )r
   _raw_clientselfr    r   o/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/service_accounts/api_keys/client.py__init__      zApiKeysClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawApiKeysClient
        r   r   r   r   r   with_raw_response      	zApiKeysClient.with_raw_responseNrequest_optionsservice_account_user_idr    c                C   s   | j j||d}|jS )ag  
        Get all API keys for a service account

        Parameters
        ----------
        service_account_user_id : str

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

        Returns
        -------
        WorkspaceApiKeyListResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.list(
            service_account_user_id="service_account_user_id",
        )
        r   r   listdatar   r!   r    	_responser   r   r   r#   $   s   zApiKeysClient.listcharacter_limitr    namepermissionsr(   c                C   s   | j j|||||d}|jS )aQ  
        Create a new API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        name : str

        permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        WorkspaceCreateApiKeyResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.create(
            service_account_user_id="service_account_user_id",
            name="name",
        )
        r)   r*   r(   r    r   creater$   r   r!   r)   r*   r(   r    r&   r   r   r   r-   D   s   ,zApiKeysClient.create
api_key_idc                C   s   | j j|||d}|jS )a  
        Delete an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

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

        Returns
        -------
        typing.Any
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.delete(
            service_account_user_id="service_account_user_id",
            api_key_id="api_key_id",
        )
        r   r   deleter$   r   r!   r/   r    r&   r   r   r   r1   y   s    zApiKeysClient.delete
is_enabledc          	   	   C   s    | j j|||||||d}|jS )aP  
        Update an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

        is_enabled : bool
            Whether to enable or disable the API key.

        name : str
            The name of the XI API key to use (used for identification purposes only).

        permissions : BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        typing.Any
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.update(
            service_account_user_id="service_account_user_id",
            api_key_id="api_key_id",
            is_enabled=True,
            name="Sneaky Fox",
        )
        r3   r)   r*   r(   r    r   updater$   	r   r!   r/   r3   r)   r*   r(   r    r&   r   r   r   r6      s   6	zApiKeysClient.update)__name__
__module____qualname__r   r   propertyr
   r   strtypingOptionalr   r   r#   OMITr   intr   r-   Anyr1   boolr   r6   r   r   r   r   r      sp    
&
6
+	
r   c                   @   r   )AsyncApiKeysClientr   c                C   r   r   )r	   r   r   r   r   r   r      r   zAsyncApiKeysClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawApiKeysClient
        r   r   r   r   r   r      r   z$AsyncApiKeysClient.with_raw_responseNr   r!   r    c                   s   | j j||dI dH }|jS )a  
        Get all API keys for a service account

        Parameters
        ----------
        service_account_user_id : str

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

        Returns
        -------
        WorkspaceApiKeyListResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.list(
                service_account_user_id="service_account_user_id",
            )


        asyncio.run(main())
        r   Nr"   r%   r   r   r   r#      s   %zAsyncApiKeysClient.listr'   r)   r*   r(   c                   s$   | j j|||||dI dH }|jS )a  
        Create a new API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        name : str

        permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        WorkspaceCreateApiKeyResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.create(
                service_account_user_id="service_account_user_id",
                name="name",
            )


        asyncio.run(main())
        r+   Nr,   r.   r   r   r   r-     s   4zAsyncApiKeysClient.creater/   c                   s    | j j|||dI dH }|jS )a  
        Delete an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

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

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.delete(
                service_account_user_id="service_account_user_id",
                api_key_id="api_key_id",
            )


        asyncio.run(main())
        r   Nr0   r2   r   r   r   r1   R  s   (zAsyncApiKeysClient.deleter3   c          	   	      s(   | j j|||||||dI dH }|jS )a  
        Update an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

        is_enabled : bool
            Whether to enable or disable the API key.

        name : str
            The name of the XI API key to use (used for identification purposes only).

        permissions : BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.update(
                service_account_user_id="service_account_user_id",
                api_key_id="api_key_id",
                is_enabled=True,
                name="Sneaky Fox",
            )


        asyncio.run(main())
        r4   Nr5   r7   r   r   r   r6   }  s   >	zAsyncApiKeysClient.update)r8   r9   r:   r   r   r;   r	   r   r<   r=   r>   r   r   r#   r?   r   r@   r   r-   rA   r1   rB   r   r6   r   r   r   r   rC      sp    
.
>
3	
rC   )r=   core.client_wrapperr   r   core.request_optionsr   +types.workspace_api_key_list_response_modelr   -types.workspace_create_api_key_response_modelr   
raw_clientr	   r
   ptypes.body_create_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_post_permissionsr   ztypes.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_permissionsr   castrA   r?   r   rC   r   r   r   r   <module>   s    J