
    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mZ  e j                  e j                  d	      Z G d
 d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)$ChapterSnapshotExtendedResponseModel)ChapterSnapshotsResponse   )AsyncRawSnapshotsClientRawSnapshotsClient.c                      e Zd ZdefdZedefd       Zdddeded	e	j                  e   defd
Zdddededed	e	j                  e   def
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Zy)SnapshotsClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     /root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/studio/projects/chapters/snapshots/client.py__init__zSnapshotsClient.__init__   s    -^L    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSnapshotsClient
        r   r   s    r   with_raw_responsez!SnapshotsClient.with_raw_response        r   Nrequest_options
project_id
chapter_idr   c                V    | j                   j                  |||      }|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   	_responses        r   r#   zSnapshotsClient.list   s-    D $$))*jRa)b	~~r   chapter_snapshot_idc                X    | j                   j                  ||||      }|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&   s         r   r*   zSnapshotsClient.getC   s0    V $$((ZATfu(v	~~r   convert_to_mpegr   r-   c             #      K   | j                   j                  |||||      5 }|j                  E d{    ddd       y7 # 1 sw Y   yxY ww)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   rs          r   r0   zSnapshotsClient.streamq   sb     ^ $$++ % 
 	 vv	 	 	 	s+   !AAAA	AAAA)__name__
__module____qualname__r   r   propertyr   r   strtypingOptionalr   r   r#   r   r*   OMITboolIteratorbytesr0    r   r   r   r      s   M*; M  #5     gk##+.#DJOOTbDc#	!#V <@,, , !	,  8, 
.,h 26;?66 6 !	6  .6  86 
	6r   r   c                      e Zd ZdefdZedefd       Zdddeded	e	j                  e   defd
Zdddededed	e	j                  e   def
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Zy)AsyncSnapshotsClientr   c                &    t        |      | _        y r   )r
   r   r   s     r   r   zAsyncSnapshotsClient.__init__   s    2.Qr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSnapshotsClient
        r   r   s    r   r   z&AsyncSnapshotsClient.with_raw_response   r   r   Nr   r   r    r   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)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%   s        r   r#   zAsyncSnapshotsClient.list   s:     T **//
JXg/hh	~~ is   "757r'   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)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+   s         r   r*   zAsyncSnapshotsClient.get   sD     f **..
$7 / 
 
	 ~~
s   #868r,   r-   c                  K   | j                   j                  |||||      4 d{   }|j                  2 3 d{   }| 7 7 6 ddd      d{  7   y# 1 d{  7  sw Y   yxY ww)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   r1   _chunks           r   r0   zAsyncSnapshotsClient.stream  s     n ##**++ + 
 	 	  !  f		 	 	 	 	se   %A3AA3AAA	A AA3	AAA3AA3A0$A'%A0,A3)r2   r3   r4   r   r   r5   r
   r   r6   r7   r8   r   r   r#   r   r*   r9   r:   AsyncIteratorr<   r0   r=   r   r   r?   r?      s   R*< R  #:     gk+++.+DJOOTbDc+	!+f <@66 6 !	6  86 
.6| 26;??? ? !	?  .?  8? 
		e	$?r   r?   )r7   core.client_wrapperr   r   core.request_optionsr   .types.chapter_snapshot_extended_response_modelr    types.chapter_snapshots_responser   
raw_clientr
   r   castAnyr9   r   r?   r=   r   r   <module>rN      sJ     J 4 d J C v{{6::s#X Xvs sr   