o
    lWi*                     @   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 ddlmZ dd	lmZ d
dlmZmZ e e jdZG dd dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)#DeleteWorkspaceWebhookResponseModel)"PatchWorkspaceWebhookResponseModel)WebhookHmacSettings)#WorkspaceCreateWebhookResponseModel)!WorkspaceWebhookListResponseModel   )AsyncRawWebhooksClientRawWebhooksClient.c                   @      e Zd ZdefddZedefddZdddd	ej	e
 d
ej	e defddZddded
ej	e defddZddded
ej	e defddZdddede
ded
ej	e def
ddZdS )WebhooksClientclient_wrapperc                C      t |d| _d S N)r   )r   _raw_clientselfr    r   ^/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/webhooks/client.py__init__      zWebhooksClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawWebhooksClient
        r   r   r   r   r   with_raw_response      	z WebhooksClient.with_raw_responseNinclude_usagesrequest_optionsr!   r"   c                C      | j j||d}|jS )a  
        List all webhooks for a workspace

        Parameters
        ----------
        include_usages : typing.Optional[bool]
            Whether to include active usages of the webhook, only usable by admins

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

        Returns
        -------
        WorkspaceWebhookListResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.webhooks.list(
            include_usages=False,
        )
        r    r   listdatar   r!   r"   	_responser   r   r   r%   !      zWebhooksClient.listr"   settingsc                C   r#   )a4  
        Create a new webhook for the workspace with the specified authentication type.

        Parameters
        ----------
        settings : WebhookHmacSettings
            Webhook settings object containing auth_type and corresponding configuration

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

        Returns
        -------
        WorkspaceCreateWebhookResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs, WebhookHmacSettings

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.webhooks.create(
            settings=WebhookHmacSettings(
                name="name",
                webhook_url="webhook_url",
            ),
        )
        r+   r"   r   creater&   r   r+   r"   r(   r   r   r   r.   B   s   !zWebhooksClient.create
webhook_idc                C   r#   )ap  
        Delete the specified workspace webhook

        Parameters
        ----------
        webhook_id : str
            The unique ID for the webhook

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

        Returns
        -------
        DeleteWorkspaceWebhookResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.webhooks.delete(
            webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K",
        )
        r*   r   deleter&   r   r0   r"   r(   r   r   r   r2   f   r)   zWebhooksClient.deleteis_disablednamec                C   s   | j j||||d}|jS )ah  
        Update the specified workspace webhook

        Parameters
        ----------
        webhook_id : str
            The unique ID for the webhook

        is_disabled : bool
            Whether to disable or enable the webhook

        name : str
            The display name of the webhook (used for display purposes only).

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

        Returns
        -------
        PatchWorkspaceWebhookResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.webhooks.update(
            webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K",
            is_disabled=True,
            name="My Callback Webhook",
        )
        r4   r5   r"   r   updater&   r   r0   r4   r5   r"   r(   r   r   r   r8      s   &zWebhooksClient.update)__name__
__module____qualname__r   r   propertyr   r   typingOptionalboolr   r
   r%   r   r	   r.   strr   r2   r   r8   r   r   r   r   r      sP    
"
%
"r   c                   @   r   )AsyncWebhooksClientr   c                C   r   r   )r   r   r   r   r   r   r      r   zAsyncWebhooksClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawWebhooksClient
        r   r   r   r   r   r      r   z%AsyncWebhooksClient.with_raw_responseNr    r!   r"   c                      | j j||dI dH }|jS )a  
        List all webhooks for a workspace

        Parameters
        ----------
        include_usages : typing.Optional[bool]
            Whether to include active usages of the webhook, only usable by admins

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

        Returns
        -------
        WorkspaceWebhookListResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.webhooks.list(
                include_usages=False,
            )


        asyncio.run(main())
        r    Nr$   r'   r   r   r   r%         &zAsyncWebhooksClient.listr*   r+   c                   rC   )a  
        Create a new webhook for the workspace with the specified authentication type.

        Parameters
        ----------
        settings : WebhookHmacSettings
            Webhook settings object containing auth_type and corresponding configuration

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

        Returns
        -------
        WorkspaceCreateWebhookResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, WebhookHmacSettings

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.webhooks.create(
                settings=WebhookHmacSettings(
                    name="name",
                    webhook_url="webhook_url",
                ),
            )


        asyncio.run(main())
        r,   Nr-   r/   r   r   r   r.      s   )zAsyncWebhooksClient.creater0   c                   rC   )a  
        Delete the specified workspace webhook

        Parameters
        ----------
        webhook_id : str
            The unique ID for the webhook

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

        Returns
        -------
        DeleteWorkspaceWebhookResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.webhooks.delete(
                webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K",
            )


        asyncio.run(main())
        r*   Nr1   r3   r   r   r   r2     rD   zAsyncWebhooksClient.deleter4   r5   c                   s"   | j j||||dI dH }|jS )a  
        Update the specified workspace webhook

        Parameters
        ----------
        webhook_id : str
            The unique ID for the webhook

        is_disabled : bool
            Whether to disable or enable the webhook

        name : str
            The display name of the webhook (used for display purposes only).

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

        Returns
        -------
        PatchWorkspaceWebhookResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.webhooks.update(
                webhook_id="G007vmtq9uWYl7SUW9zGS8GZZa1K",
                is_disabled=True,
                name="My Callback Webhook",
            )


        asyncio.run(main())
        r6   Nr7   r9   r   r   r   r8   @  s
   .zAsyncWebhooksClient.update)r:   r;   r<   r   r   r=   r   r   r>   r?   r@   r   r
   r%   r   r	   r.   rA   r   r2   r   r8   r   r   r   r   rB      sP    
*
-
*rB   )r>   core.client_wrapperr   r   core.request_optionsr   -types.delete_workspace_webhook_response_modelr   ,types.patch_workspace_webhook_response_modelr   types.webhook_hmac_settingsr   -types.workspace_create_webhook_response_modelr	   +types.workspace_webhook_list_response_modelr
   
raw_clientr   r   castAnyOMITr   rB   r   r   r   r   <module>   s    "