
    b6i:                         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 j&                  e j(                  d      Z G d d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)BatchCallDetailedResponse)BatchCallResponse)BatchCallWhatsAppParams)OutboundCallRecipient)WorkspaceBatchCallsResponse   )AsyncRawBatchCallsClientRawBatchCallsClient.c                   D   e Zd ZdefdZedefd       Zee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
j                  e	   de
j                  e   defdZddddde
j                  e   de
j                  e	   de
j                  e   defdZddde	de
j                  e   defdZddde	de
j                  e   ddfdZddde	de
j                  e   defdZddde	de
j                  e   defdZy)BatchCallsClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     z/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/conversational_ai/batch_calls/client.py__init__zBatchCallsClient.__init__   s    .nM    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawBatchCallsClient
        r   r   s    r   with_raw_responsez"BatchCallsClient.with_raw_response        r   Nscheduled_time_unixagent_phone_number_idwhatsapp_paramstimezonerequest_options	call_nameagent_id
recipientsr!   r"   r#   r$   r%   c          
      `    | j                   j                  ||||||||      }	|	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]

        whatsapp_params : typing.Optional[BatchCallWhatsAppParams]

        timezone : 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$   r%   r   createdata
r   r&   r'   r(   r!   r"   r#   r$   r%   	_responses
             r   r,   zBatchCallsClient.create!   sD    h $$++! 3"7++ , 	
	 ~~r   limitlast_docr%   r1   r2   c                V    | j                   j                  |||      }|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",
        )
        r0   r   listr-   r   r1   r2   r%   r/   s        r   r5   zBatchCallsClient.lista   s-    H $$))Zi)j	~~r   r%   batch_idc                T    | j                   j                  ||      }|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",
        )
        r7   r   getr-   r   r8   r%   r/   s       r   r;   zBatchCallsClient.get   s)    : $$((?(S	~~r   c                T    | j                   j                  ||      }|j                  S )a9  
        Permanently delete a batch call and all recipient records. Conversations remain in history.

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

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

        Returns
        -------
        None

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.batch_calls.delete(
            batch_id="batch_id",
        )
        r7   r   deleter-   r<   s       r   r?   zBatchCallsClient.delete   s)    4 $$++Ho+V	~~r   c                T    | j                   j                  ||      }|j                  S )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",
        )
        r7   r   cancelr-   r<   s       r   rB   zBatchCallsClient.cancel   s)    6 $$++Ho+V	~~r   c                T    | j                   j                  ||      }|j                  S )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",
        )
        r7   r   retryr-   r<   s       r   rE   zBatchCallsClient.retry   s)    6 $$**8_*U	~~r   )__name__
__module____qualname__r   r   propertyr   r   OMITstrtypingSequencer
   Optionalintr	   r   r   r,   r   r5   r   r;   r?   rB   rE    r   r   r   r      s   N*; N  #6      596:DH)-;?> > 	>
 OO$9:> $__S1>  &s3>  )@A> //#&>  8> 
>F '+)-;?% s#% //#&	%
  8% 
%%P TX171P	"@ [_ s 8W cg : [_ s 8W ct < Z^ c v~7V bs r   r   c                   D   e Zd ZdefdZedefd       Zee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
j                  e	   de
j                  e   defdZddddde
j                  e   de
j                  e	   de
j                  e   defdZddde	de
j                  e   defdZddde	de
j                  e   ddfdZddde	de
j                  e   defdZddde	de
j                  e   defdZy)AsyncBatchCallsClientr   c                &    t        |      | _        y r   )r   r   r   s     r   r   zAsyncBatchCallsClient.__init__  s    3>Rr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawBatchCallsClient
        r   r   s    r   r   z'AsyncBatchCallsClient.with_raw_response  r   r   Nr    r&   r'   r(   r!   r"   r#   r$   r%   c          
      |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)ah  
        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]

        whatsapp_params : typing.Optional[BatchCallWhatsAppParams]

        timezone : 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.   s
             r   r,   zAsyncBatchCallsClient.create  sR     x **11! 3"7++ 2 	
 	
	 ~~	
s   '<:<r0   r1   r2   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)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())
        r0   Nr4   r6   s        r   r5   zAsyncBatchCallsClient.listY  s:     X **//eh`o/pp	~~ qs   "757r7   r8   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)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())
        r7   Nr:   r<   s       r   r;   zAsyncBatchCallsClient.get  s7     J **..x.YY	~~ Z   !646c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Permanently delete a batch call and all recipient records. Conversations remain in history.

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

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r7   Nr>   r<   s       r   r?   zAsyncBatchCallsClient.delete  s7     D **11(O1\\	~~ ]rX   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)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())
        r7   NrA   r<   s       r   rB   zAsyncBatchCallsClient.cancel  s7     J **11(O1\\	~~ ]rX   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)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())
        r7   NrD   r<   s       r   rE   zAsyncBatchCallsClient.retry  s7     J **00?0[[	~~ \rX   )rF   rG   rH   r   r   rI   r   r   rJ   rK   rL   rM   r
   rN   rO   r	   r   r   r,   r   r5   r   r;   r?   rB   rE   rP   r   r   rR   rR     s   S*< S  #;      596:DH)-;?F F 	F
 OO$9:F $__S1F  &s3F  )@AF //#&F  8F 
FV '+)-;?- s#- //#&	-
  8- 
%-` TX&&171P&	"&P ae #S #foon>] #im #L TX&&171P&	&R TX&&171P&	&r   rR   )rL   core.client_wrapperr   r   core.request_optionsr   "types.batch_call_detailed_responser   types.batch_call_responser   !types.batch_call_whats_app_paramsr	   types.outbound_call_recipientr
   $types.workspace_batch_calls_responser   
raw_clientr   r   castAnyrJ   r   rR   rP   r   r   <module>rf      sS     H 2 K : H B O E v{{6::s#m m`a ar   