
    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)SegmentDeleteResponse)SegmentUpdateResponse   )AsyncRawSegmentClientRawSegmentClient.c                      e Zd ZdefdZedefd       Zeeeddde	de	d	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e	de	de
j                  e   defdZy)SegmentClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     u/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/dubbing/resource/segment/client.py__init__zSegmentClient.__init__   s    +>J    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSegmentClient
        r   r   s    r   with_raw_responsezSegmentClient.with_raw_response        r   N
start_timeend_timetextrequest_options
dubbing_id
segment_idlanguager   r   r    r!   c          	      ^    | j                   j                  |||||||      }|j                  S )a  
        Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        segment_id : str
            ID of the segment

        language : str
            ID of the language.

        start_time : typing.Optional[float]

        end_time : typing.Optional[float]

        text : typing.Optional[str]

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

        Returns
        -------
        SegmentUpdateResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.resource.segment.update(
            dubbing_id="dubbing_id",
            segment_id="segment_id",
            language="language",
        )
        r   r   updatedata	r   r"   r#   r$   r   r   r    r!   	_responses	            r   r'   zSegmentClient.update   sA    h $$++!+ , 
	 ~~r   r!   c                V    | j                   j                  |||      }|j                  S )a  
        Deletes a single segment from the dubbing.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        segment_id : str
            ID of the segment

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

        Returns
        -------
        SegmentDeleteResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.resource.segment.delete(
            dubbing_id="dubbing_id",
            segment_id="segment_id",
        )
        r+   r   deleter(   r   r"   r#   r!   r*   s        r   r.   zSegmentClient.delete]   s-    D $$++J
Tc+d	~~r   )__name__
__module____qualname__r   r   propertyr   r   OMITstrtypingOptionalfloatr   r   r'   r   r.    r   r   r   r      s    K*; K  #3      .2+/%);?== = 	= OOE*= //%(= ooc"=  8= 
=@ gk##+.#DJOOTbDc#	#r   r   c                      e Zd ZdefdZedefd       Zeeeddde	de	d	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e	de	de
j                  e   defdZy)AsyncSegmentClientr   c                &    t        |      | _        y r   )r
   r   r   s     r   r   zAsyncSegmentClient.__init__   s    0Or   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSegmentClient
        r   r   s    r   r   z$AsyncSegmentClient.with_raw_response   r   r   Nr   r"   r#   r$   r   r   r    r!   c          	      z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)a  
        Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        segment_id : str
            ID of the segment

        language : str
            ID of the language.

        start_time : typing.Optional[float]

        end_time : typing.Optional[float]

        text : typing.Optional[str]

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

        Returns
        -------
        SegmentUpdateResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.resource.segment.update(
                dubbing_id="dubbing_id",
                segment_id="segment_id",
                language="language",
            )


        asyncio.run(main())
        r   Nr&   r)   s	            r   r'   zAsyncSegmentClient.update   sO     x **11!+ 2 
 
	 ~~
s   &;9;r+   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a8  
        Deletes a single segment from the dubbing.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        segment_id : str
            ID of the segment

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

        Returns
        -------
        SegmentDeleteResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.resource.segment.delete(
                dubbing_id="dubbing_id",
                segment_id="segment_id",
            )


        asyncio.run(main())
        r+   Nr-   r/   s        r   r.   zAsyncSegmentClient.delete   s:     T **11*jZi1jj	~~ ks   "757)r0   r1   r2   r   r   r3   r
   r   r4   r5   r6   r7   r8   r   r   r'   r   r.   r9   r   r   r;   r;      s    P*< P  #8      .2+/%);?EE E 	E OOE*E //%(E ooc"E  8E 
EP gk+++.+DJOOTbDc+	+r   r;   )r6   core.client_wrapperr   r   core.request_optionsr   types.segment_delete_responser   types.segment_update_responser   
raw_clientr
   r   castAnyr4   r   r;   r9   r   r   <module>rG      sJ     I 3 C C ? v{{6::s#q qhA Ar   