o
    lWi;-                     @   sz   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 e e jd	ZG d
d dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)$ChapterSnapshotExtendedResponseModel)ChapterSnapshotsResponse   )AsyncRawSnapshotsClientRawSnapshotsClient.c                   @      e Zd ZdefddZedefddZddd	e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eddd	ed
edede	j
e de	j
e de	je fddZdS )SnapshotsClientclient_wrapperc                C      t |d| _d S N)r   )r
   _raw_clientselfr    r   x/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/studio/projects/chapters/snapshots/client.py__init__      zSnapshotsClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSnapshotsClient
        r   r   r   r   r   with_raw_response      	z!SnapshotsClient.with_raw_responseNrequest_options
project_id
chapter_idr   c                C   s   | j j|||d}|jS )ah  
        Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created.

        Parameters
        ----------
        project_id : str
            The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.

        chapter_id : str
            The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.

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

        Returns
        -------
        ChapterSnapshotsResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.chapters.snapshots.list(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   listdatar   r   r    r   	_responser   r   r   r"      s   "zSnapshotsClient.listchapter_snapshot_idc                C   s   | j j||||d}|jS )aj  
        Returns the chapter snapshot.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        chapter_id : str
            The ID of the chapter.

        chapter_snapshot_id : str
            The ID of the chapter snapshot.

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

        Returns
        -------
        ChapterSnapshotExtendedResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.chapters.snapshots.get(
            project_id="21m00Tcm4TlvDq8ikWAM",
            chapter_id="21m00Tcm4TlvDq8ikWAM",
            chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   getr#   r   r   r    r&   r   r%   r   r   r   r(   C   s   +zSnapshotsClient.getconvert_to_mpegr   r+   c                c   sJ    | j j|||||d}|jE dH  W d   dS 1 sw   Y  dS )a-  
        Stream the audio from a chapter snapshot. Use `GET /v1/studio/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the snapshots of a chapter.

        Parameters
        ----------
        project_id : str
            The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.

        chapter_id : str
            The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.

        chapter_snapshot_id : str
            The ID of the chapter snapshot to be used. You can use the [List project chapter snapshots](/docs/api-reference/studio/get-snapshots) endpoint to list all the available snapshots.

        convert_to_mpeg : typing.Optional[bool]
            Whether to convert the audio to mpeg format.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.Iterator[bytes]
            Streaming audio data

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.chapters.snapshots.stream(
            project_id="project_id",
            chapter_id="chapter_id",
            chapter_snapshot_id="chapter_snapshot_id",
        )
        r*   Nr   streamr#   )r   r   r    r&   r+   r   rr   r   r   r-   q   s   /"zSnapshotsClient.stream)__name__
__module____qualname__r   r   propertyr
   r   strtypingOptionalr   r   r"   r   r(   OMITboolIteratorbytesr-   r   r   r   r   r      sR    
+
4r   c                   @   r   )AsyncSnapshotsClientr   c                C   r   r   )r	   r   r   r   r   r   r      r   zAsyncSnapshotsClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSnapshotsClient
        r   r   r   r   r   r      r   z&AsyncSnapshotsClient.with_raw_responseNr   r   r    r   c                   s    | j j|||dI dH }|jS )a  
        Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created.

        Parameters
        ----------
        project_id : str
            The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.

        chapter_id : str
            The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.

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

        Returns
        -------
        ChapterSnapshotsResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.chapters.snapshots.list(
                project_id="21m00Tcm4TlvDq8ikWAM",
                chapter_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r   Nr!   r$   r   r   r   r"      s   *zAsyncSnapshotsClient.listr&   c                   s"   | j j||||dI dH }|jS )a  
        Returns the chapter snapshot.

        Parameters
        ----------
        project_id : str
            The ID of the Studio project.

        chapter_id : str
            The ID of the chapter.

        chapter_snapshot_id : str
            The ID of the chapter snapshot.

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

        Returns
        -------
        ChapterSnapshotExtendedResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.chapters.snapshots.get(
                project_id="21m00Tcm4TlvDq8ikWAM",
                chapter_id="21m00Tcm4TlvDq8ikWAM",
                chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r   Nr'   r)   r   r   r   r(      s
   3zAsyncSnapshotsClient.getr*   r+   c             	   C  sn   | j j|||||d4 I dH }|j2 z	3 dH W }|V  q6 W d  I dH  dS 1 I dH s0w   Y  dS )a  
        Stream the audio from a chapter snapshot. Use `GET /v1/studio/projects/{project_id}/chapters/{chapter_id}/snapshots` to return the snapshots of a chapter.

        Parameters
        ----------
        project_id : str
            The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.

        chapter_id : str
            The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters.

        chapter_snapshot_id : str
            The ID of the chapter snapshot to be used. You can use the [List project chapter snapshots](/docs/api-reference/studio/get-snapshots) endpoint to list all the available snapshots.

        convert_to_mpeg : typing.Optional[bool]
            Whether to convert the audio to mpeg format.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.AsyncIterator[bytes]
            Streaming audio data

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.chapters.snapshots.stream(
                project_id="project_id",
                chapter_id="chapter_id",
                chapter_snapshot_id="chapter_snapshot_id",
            )


        asyncio.run(main())
        r*   Nr,   )r   r   r    r&   r+   r   r.   _chunkr   r   r   r-     s   7.zAsyncSnapshotsClient.stream)r/   r0   r1   r   r   r2   r	   r   r3   r4   r5   r   r   r"   r   r(   r6   r7   AsyncIteratorr9   r-   r   r   r   r   r:      sR    
3
>r:   )r4   core.client_wrapperr   r   core.request_optionsr   .types.chapter_snapshot_extended_response_modelr    types.chapter_snapshots_responser   
raw_clientr	   r
   castAnyr6   r   r:   r   r   r   r   <module>   s    