o
    lWiX.                     @   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)$ProjectSnapshotExtendedResponseModel)ProjectSnapshotsResponse   )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	j
e defddZddd	eded
e	j
e defddZeddd	edede	j
e d
e	j
e de	je f
ddZddd	ed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   o/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/studio/projects/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_idr   c                C   s   | j j||d}|jS )ay  
        Retrieves a list of snapshots for a Studio project.

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

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

        Returns
        -------
        ProjectSnapshotsResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.snapshots.list(
            project_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   listdatar   r   r   	_responser   r   r   r!      s   zSnapshotsClient.listproject_snapshot_idc                C   s   | j j|||d}|jS )a  
        Returns the project snapshot.

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

        project_snapshot_id : str
            The ID of the Studio project snapshot.

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

        Returns
        -------
        ProjectSnapshotExtendedResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.snapshots.get(
            project_id="21m00Tcm4TlvDq8ikWAM",
            project_snapshot_id="21m00Tcm4TlvDq8ikWAM",
        )
        r   r   getr"   r   r   r%   r   r$   r   r   r   r'   ?   s   "zSnapshotsClient.getconvert_to_mpegr   r*   c                c   sH    | j j||||d}|jE dH  W d   dS 1 sw   Y  dS )aA  
        Stream the audio from a Studio project snapshot.

        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.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        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]
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.snapshots.stream(
            project_id="project_id",
            project_snapshot_id="project_snapshot_id",
        )
        r)   Nr   streamr"   )r   r   r%   r*   r   rr   r   r   r,   d   s   *"zSnapshotsClient.streamc                c   sF    | j j|||d}|jE dH  W d   dS 1 sw   Y  dS )a  
        Returns a compressed archive of the Studio project's audio.

        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.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        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 archive data

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.studio.projects.snapshots.stream_archive(
            project_id="project_id",
            project_snapshot_id="project_snapshot_id",
        )
        r   Nr   stream_archiver"   )r   r   r%   r   r-   r   r   r   r/      s   ""zSnapshotsClient.stream_archive)__name__
__module____qualname__r   r   propertyr
   r   strtypingOptionalr   r   r!   r   r'   OMITboolIteratorbytesr,   r/   r   r   r   r   r      sZ    
"
*
0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   c                   s   | j j||dI dH }|jS )a  
        Retrieves a list of snapshots for a Studio project.

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

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

        Returns
        -------
        ProjectSnapshotsResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.snapshots.list(
                project_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 )av  
        Returns the project snapshot.

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

        project_snapshot_id : str
            The ID of the Studio project snapshot.

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

        Returns
        -------
        ProjectSnapshotExtendedResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   Nr&   r(   r   r   r   r'      s   *zAsyncSnapshotsClient.getr)   r*   c             	   C  sl   | 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 s/w   Y  dS )a  
        Stream the audio from a Studio project snapshot.

        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.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        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]
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r)   Nr+   )r   r   r%   r*   r   r-   _chunkr   r   r   r,     s   2.zAsyncSnapshotsClient.streamc             	   C  sj   | 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 s.w   Y  dS )al  
        Returns a compressed archive of the Studio project's audio.

        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.

        project_snapshot_id : str
            The ID of the Studio project snapshot.

        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 archive data

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.studio.projects.snapshots.stream_archive(
                project_id="project_id",
                project_snapshot_id="project_snapshot_id",
            )


        asyncio.run(main())
        r   Nr.   )r   r   r%   r   r-   r<   r   r   r   r/   V  s   *.z#AsyncSnapshotsClient.stream_archive)r0   r1   r2   r   r   r3   r	   r   r4   r5   r6   r   r   r!   r   r'   r7   r8   AsyncIteratorr:   r,   r/   r   r   r   r   r;      sZ    
*
2
9r;   )r5   core.client_wrapperr   r   core.request_optionsr   .types.project_snapshot_extended_response_modelr    types.project_snapshots_responser   
raw_clientr	   r
   castAnyr7   r   r;   r   r   r   r   <module>   s    +