
    j                         d dl Z ddlmZ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   )AsyncRawOllieStateClientRawOllieStateClient.c                   0   e Zd ZdefdZedefd       Zdddej                  e
   dej                  e   fdZddd	ej                  eej                  e   ej                  e   f   dej                  e
   ddfd
Zdddej                  e
   ddfdZy)OllieStateClientclient_wrapperc                &    t        |      | _        y N)r   )r	   _raw_clientselfr   s     y/Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/opik/rest_api/ollie_state/client.py__init__zOllieStateClient.__init__   s    .nM    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawOllieStateClient
        r   r   s    r   with_raw_responsez"OllieStateClient.with_raw_response        r   Nrequest_optionsr   c             #      K   | j                   j                  |      5 }|j                  E d{    ddd       y7 # 1 sw Y   yxY ww)aO  
        Download stored ollie state file

        Parameters
        ----------
        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]
            Ollie state file

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.ollie_state.download_ollie_state()
        r   Nr   download_ollie_statedata)r   r   rs      r   r   z%OllieStateClient.download_ollie_state   sE     , 22?2SWXvv TS TSs%   A?=?	A?AArequestc                T    | j                   j                  ||      }|j                  S )l  
        Upload gzip-compressed SQLite DB file, replacing any existing state

        Parameters
        ----------
        request : typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]

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

        Returns
        -------
        None
        r"   r   r   replace_ollie_stater    r   r"   r   	_responses       r   r'   z$OllieStateClient.replace_ollie_state5   s*    ( $$88Zi8j	~~r   c                R    | j                   j                  |      }|j                  S )a  
        Clear stored ollie state

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.ollie_state.delete_ollie_state()
        r   r   delete_ollie_stater    r   r   r)   s      r   r,   z#OllieStateClient.delete_ollie_stateL   s'    & $$777X	~~r   )__name__
__module____qualname__r   r   propertyr	   r   typingOptionalr   Iteratorbytesr   UnionAsyncIteratorr'   r,    r   r   r   r      s    N*; N  #6     EI"(//."A		: <@	 eV__U%;V=Q=QRW=XXY  8	
 
. X\ V__^5T `d r   r   c                   0   e Zd ZdefdZedefd       Zdddej                  e
   dej                  e   fdZddd	ej                  eej                  e   ej                  e   f   dej                  e
   ddfd
Zdddej                  e
   ddfdZy)AsyncOllieStateClientr   c                &    t        |      | _        y r   )r   r   r   s     r   r   zAsyncOllieStateClient.__init__d   s    3>Rr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawOllieStateClient
        r   r   s    r   r   z'AsyncOllieStateClient.with_raw_responseg   r   r   Nr   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  
        Download stored ollie state file

        Parameters
        ----------
        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]
            Ollie state file

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.ollie_state.download_ollie_state()
        asyncio.run(main())
        r   Nr   )r   r   r!   r    s       r   r   z*AsyncOllieStateClient.download_ollie_stater   sY     2 ##888YY]^ff d
 Zf ZYYYYsd   !A/AA/AAAAAA/AAA/AA/A, A#!A,(A/r"   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)r$   r%   Nr&   r(   s       r   r'   z)AsyncOllieStateClient.replace_ollie_state   s7     ( **>>w`o>pp	~~ qs   !646c                n   K   | j                   j                  |       d{   }|j                  S 7 w)a  
        Clear stored ollie state

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.ollie_state.delete_ollie_state()
        asyncio.run(main())
        r   Nr+   r-   s      r   r,   z(AsyncOllieStateClient.delete_ollie_state   s4     , **==o=^^	~~ _s    535)r.   r/   r0   r   r   r1   r   r   r2   r3   r   r7   r5   r   r6   r4   r'   r,   r8   r   r   r:   r:   c   s    S*< S  #;     EI"(//."A			e	$B <@	 eV__U%;V=Q=QRW=XXY  8	
 
. ^b 6??>;Z fj r   r:   )r2   core.client_wrapperr   r   core.request_optionsr   
raw_clientr   r	   castAnyOMITr   r:   r8   r   r   <module>rF      sD     G 1 E v{{6::s#S SlZ Zr   