o
    lWiP1                     @   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mZ e e jdZG dd dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)BatchCallDetailedResponse)BatchCallResponse)OutboundCallRecipient)WorkspaceBatchCallsResponse   )AsyncRawBatchCallsClientRawBatchCallsClient.c                   @     e Zd ZdefddZedefddZeeddd	e	d
e	de
je de
je de
je	 de
je defddZddddde
j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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S )BatchCallsClientclient_wrapperc                C      t |d| _d S N)r   )r   _raw_clientselfr    r   s/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/conversational_ai/batch_calls/client.py__init__      zBatchCallsClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawBatchCallsClient
        r   r   r   r   r   with_raw_response      	z"BatchCallsClient.with_raw_responseNscheduled_time_unixagent_phone_number_idrequest_options	call_nameagent_id
recipientsr    r!   r"   c                C   s   | j j||||||d}|jS )a}  
        Submit a batch call request to schedule calls for multiple recipients.

        Parameters
        ----------
        call_name : str

        agent_id : str

        recipients : typing.Sequence[OutboundCallRecipient]

        scheduled_time_unix : typing.Optional[int]

        agent_phone_number_id : typing.Optional[str]

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

        Returns
        -------
        BatchCallResponse
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs, OutboundCallRecipient

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.batch_calls.create(
            call_name="call_name",
            agent_id="agent_id",
            recipients=[OutboundCallRecipient()],
        )
        r#   r$   r%   r    r!   r"   r   createdatar   r#   r$   r%   r    r!   r"   	_responser   r   r   r(       s   .zBatchCallsClient.createlimitlast_docr"   r-   r.   c                C   s   | j j|||d}|jS )a  
        Get all batch calls for the current workspace.

        Parameters
        ----------
        limit : typing.Optional[int]

        last_doc : typing.Optional[str]

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

        Returns
        -------
        WorkspaceBatchCallsResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.batch_calls.list(
            limit=1,
            last_doc="last_doc",
        )
        r,   r   listr)   r   r-   r.   r"   r+   r   r   r   r0   X   s   $zBatchCallsClient.listr"   batch_idc                C      | j j||d}|jS )aU  
        Get detailed information about a batch call including all recipients.

        Parameters
        ----------
        batch_id : str

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

        Returns
        -------
        BatchCallDetailedResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.batch_calls.get(
            batch_id="batch_id",
        )
        r2   r   getr)   r   r3   r"   r+   r   r   r   r6      s   zBatchCallsClient.getc                C   r4   )aR  
        Cancel a running batch call and set all recipients to cancelled status.

        Parameters
        ----------
        batch_id : str

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

        Returns
        -------
        BatchCallResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.batch_calls.cancel(
            batch_id="batch_id",
        )
        r2   r   cancelr)   r7   r   r   r   r9         zBatchCallsClient.cancelc                C   r4   )aN  
        Retry a batch call, calling failed and no-response recipients again.

        Parameters
        ----------
        batch_id : str

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

        Returns
        -------
        BatchCallResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.batch_calls.retry(
            batch_id="batch_id",
        )
        r2   r   retryr)   r7   r   r   r   r<      r:   zBatchCallsClient.retry)__name__
__module____qualname__r   r   propertyr   r   OMITstrtypingSequencer   Optionalintr   r   r(   r	   r0   r   r6   r9   r<   r   r   r   r   r      sX    	
;
(
" &r   c                   @   r   )AsyncBatchCallsClientr   c                C   r   r   )r   r   r   r   r   r   r      r   zAsyncBatchCallsClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawBatchCallsClient
        r   r   r   r   r   r      r   z'AsyncBatchCallsClient.with_raw_responseNr   r#   r$   r%   r    r!   r"   c                   s&   | j j||||||dI dH }|jS )a  
        Submit a batch call request to schedule calls for multiple recipients.

        Parameters
        ----------
        call_name : str

        agent_id : str

        recipients : typing.Sequence[OutboundCallRecipient]

        scheduled_time_unix : typing.Optional[int]

        agent_phone_number_id : typing.Optional[str]

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

        Returns
        -------
        BatchCallResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, OutboundCallRecipient

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.batch_calls.create(
                call_name="call_name",
                agent_id="agent_id",
                recipients=[OutboundCallRecipient()],
            )


        asyncio.run(main())
        r&   Nr'   r*   r   r   r   r(      s   6zAsyncBatchCallsClient.creater,   r-   r.   c                   s    | j j|||dI dH }|jS )a  
        Get all batch calls for the current workspace.

        Parameters
        ----------
        limit : typing.Optional[int]

        last_doc : typing.Optional[str]

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

        Returns
        -------
        WorkspaceBatchCallsResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.batch_calls.list(
                limit=1,
                last_doc="last_doc",
            )


        asyncio.run(main())
        r,   Nr/   r1   r   r   r   r0   +  s   ,zAsyncBatchCallsClient.listr2   r3   c                      | j j||dI dH }|jS )a  
        Get detailed information about a batch call including all recipients.

        Parameters
        ----------
        batch_id : str

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

        Returns
        -------
        BatchCallDetailedResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.batch_calls.get(
                batch_id="batch_id",
            )


        asyncio.run(main())
        r2   Nr5   r7   r   r   r   r6   Z     %zAsyncBatchCallsClient.getc                   rH   )a  
        Cancel a running batch call and set all recipients to cancelled status.

        Parameters
        ----------
        batch_id : str

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

        Returns
        -------
        BatchCallResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.batch_calls.cancel(
                batch_id="batch_id",
            )


        asyncio.run(main())
        r2   Nr8   r7   r   r   r   r9     rI   zAsyncBatchCallsClient.cancelc                   rH   )a  
        Retry a batch call, calling failed and no-response recipients again.

        Parameters
        ----------
        batch_id : str

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

        Returns
        -------
        BatchCallResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.batch_calls.retry(
                batch_id="batch_id",
            )


        asyncio.run(main())
        r2   Nr;   r7   r   r   r   r<     rI   zAsyncBatchCallsClient.retry)r=   r>   r?   r   r   r@   r   r   rA   rB   rC   rD   r   rE   rF   r   r   r(   r	   r0   r   r6   r9   r<   r   r   r   r   rG      st    	
C
0
)
)rG   )rC   core.client_wrapperr   r   core.request_optionsr   "types.batch_call_detailed_responser   types.batch_call_responser   types.outbound_call_recipientr   $types.workspace_batch_calls_responser	   
raw_clientr   r   castAnyrA   r   rG   r   r   r   r   <module>   s    L