
    joC                         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 ddlm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  e j2                  e j4                  d      Z G d d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)DashboardPagePublic)DashboardPublic)JsonNodePublic)JsonNodeWrite   )AsyncRawDashboardsClientRawDashboardsClient)DashboardUpdatePublicScope)DashboardUpdatePublicType)DashboardWriteScope)DashboardWriteType.c                      e Zd ZdefdZedefd       Zdddddddddej                  e
   dej                  e
   d	ej                  e   d
ej                  e   dej                  e   dej                  e   dej                  e   defdZeeeeeddd	eded
ej                  e   dej                  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j                  e   defdZdddedej                  e   ddfdZeeeeeddded	ej                  e   dej                  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j6                  e   dej                  e   ddfdZy)DashboardsClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     x/Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/opik/rest_api/dashboards/client.py__init__zDashboardsClient.__init__   s    .nM    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawDashboardsClient
        r   r   s    r   with_raw_responsez"DashboardsClient.with_raw_response        r   Npagesizename
project_idsortingfiltersrequest_optionsr$   r%   r&   r'   r(   r)   r*   c          	      ^    | j                   j                  |||||||      }|j                  S )a  
        Find dashboards in a workspace

        Parameters
        ----------
        page : typing.Optional[int]

        size : typing.Optional[int]

        name : typing.Optional[str]

        project_id : typing.Optional[str]

        sorting : typing.Optional[str]

        filters : typing.Optional[str]

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

        Returns
        -------
        DashboardPagePublic
            Dashboard page

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.dashboards.find_dashboards()
        r#   r   find_dashboardsdata	r   r$   r%   r&   r'   r(   r)   r*   	_responses	            r   r-   z DashboardsClient.find_dashboards$   sA    T $$44!+ 5 
	 ~~r   r'   project_nametypescopedescriptionr*   configr2   r3   r4   r5   c          
      `    | j                   j                  ||||||||      }	|	j                  S )a  
        Create a new dashboard in a workspace

        Parameters
        ----------
        name : str

        config : JsonNodeWrite

        project_id : typing.Optional[str]
            Project ID. Takes precedence over project_name when both are provided.

        project_name : typing.Optional[str]
            For project scope, specify either project_id or project_name. If project_name is provided and the project does not exist, it will be created. Ignored when project_id is provided. If neither is provided, the dashboard is created at workspace level.

        type : typing.Optional[DashboardWriteType]

        scope : typing.Optional[DashboardWriteScope]

        description : typing.Optional[str]

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

        Returns
        -------
        DashboardPublic
            Created

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.dashboards.create_dashboard(name='name', config={'key': 'value'
        }, )
        r&   r6   r'   r2   r3   r4   r5   r*   r   create_dashboardr.   
r   r&   r6   r'   r2   r3   r4   r5   r*   r0   s
             r   r:   z!DashboardsClient.create_dashboardY   sD    ` $$55!%#+ 6 	
	 ~~r   r*   dashboard_idc                T    | j                   j                  ||      }|j                  S )a  
        Get dashboard by id

        Parameters
        ----------
        dashboard_id : str

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

        Returns
        -------
        DashboardPublic
            Dashboard resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.dashboards.get_dashboard_by_id(dashboard_id='dashboardId', )
        r<   r   get_dashboard_by_idr.   r   r=   r*   r0   s       r   r@   z$DashboardsClient.get_dashboard_by_id   s*    0 $$88Wf8g	~~r   c                T    | j                   j                  ||      }|j                  S )a  
        Delete dashboard by id

        Parameters
        ----------
        dashboard_id : str

        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.dashboards.delete_dashboard(dashboard_id='dashboardId', )
        r<   r   delete_dashboardr.   rA   s       r   rD   z!DashboardsClient.delete_dashboard   s*    * $$55lTc5d	~~r   r&   r3   r4   r5   r6   r*   c          	      ^    | j                   j                  |||||||      }|j                  S )aP  
        Update dashboard by id. Partial updates are supported - only provided fields will be updated.

        Parameters
        ----------
        dashboard_id : str

        name : typing.Optional[str]

        type : typing.Optional[DashboardUpdatePublicType]

        scope : typing.Optional[DashboardUpdatePublicScope]

        description : typing.Optional[str]

        config : typing.Optional[JsonNodePublic]

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

        Returns
        -------
        DashboardPublic
            Updated dashboard

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.dashboards.update_dashboard(dashboard_id='dashboardId', )
        rE   r   update_dashboardr.   	r   r=   r&   r3   r4   r5   r6   r*   r0   s	            r   rH   z!DashboardsClient.update_dashboard   sA    T $$55#+ 6 
	 ~~r   idsc                T    | j                   j                  ||      }|j                  S )a  
        Delete dashboards batch

        Parameters
        ----------
        ids : typing.Sequence[str]

        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.dashboards.delete_dashboards_batch(ids=['ids'], )
        rJ   r*   r   delete_dashboards_batchr.   r   rJ   r*   r0   s       r   rN   z(DashboardsClient.delete_dashboards_batch   s*    . $$<<Ve<f	~~r   )__name__
__module____qualname__r   r   propertyr   r!   typingOptionalintstrr   r   r-   OMITr
   r   r   r   r:   r@   rD   r   r   r	   rH   SequencerN    r   r   r   r      s   N*; N  #6     &*%)%)+/(,(,;?3 ooc"3 ooc"	3
 ooc"3 OOC(3 %3 %3  83 
3t ,0-1486:,0;?: : 	:
 OOC(: ooc*: oo01: 23: __S):  8: 
:z X\5;__^5T	6 im S fooVdFe qu 8 &*;?=A,026;?33 ooc"	3
 oo783 9:3 __S)3 /3  83 
3l `dooc*=C__^=\	r   r   c                      e Zd ZdefdZedefd       Zdddddddddej                  e
   dej                  e
   d	ej                  e   d
ej                  e   dej                  e   dej                  e   dej                  e   defdZeeeeeddd	eded
ej                  e   dej                  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j                  e   defdZdddedej                  e   ddfdZeeeeeddded	ej                  e   dej                  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j6                  e   dej                  e   ddfdZy)AsyncDashboardsClientr   c                &    t        |      | _        y r   )r   r   r   s     r   r   zAsyncDashboardsClient.__init__  s    3>Rr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawDashboardsClient
        r   r    s    r   r!   z'AsyncDashboardsClient.with_raw_response  r"   r   Nr#   r$   r%   r&   r'   r(   r)   r*   c          	      z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)a1  
        Find dashboards in a workspace

        Parameters
        ----------
        page : typing.Optional[int]

        size : typing.Optional[int]

        name : typing.Optional[str]

        project_id : typing.Optional[str]

        sorting : typing.Optional[str]

        filters : typing.Optional[str]

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

        Returns
        -------
        DashboardPagePublic
            Dashboard page

        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.dashboards.find_dashboards()
        asyncio.run(main())
        r#   Nr,   r/   s	            r   r-   z%AsyncDashboardsClient.find_dashboards'  sO     Z **::!+ ; 
 
	 ~~
   &;9;r1   r6   r2   r3   r4   r5   c          
      |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)a  
        Create a new dashboard in a workspace

        Parameters
        ----------
        name : str

        config : JsonNodeWrite

        project_id : typing.Optional[str]
            Project ID. Takes precedence over project_name when both are provided.

        project_name : typing.Optional[str]
            For project scope, specify either project_id or project_name. If project_name is provided and the project does not exist, it will be created. Ignored when project_id is provided. If neither is provided, the dashboard is created at workspace level.

        type : typing.Optional[DashboardWriteType]

        scope : typing.Optional[DashboardWriteScope]

        description : typing.Optional[str]

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

        Returns
        -------
        DashboardPublic
            Created

        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.dashboards.create_dashboard(name='name', config={'key': 'value'
            }, )
        asyncio.run(main())
        r8   Nr9   r;   s
             r   r:   z&AsyncDashboardsClient.create_dashboard_  sR     f **;;!%#+ < 	
 	
	 ~~	
s   '<:<r<   r=   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)ax  
        Get dashboard by id

        Parameters
        ----------
        dashboard_id : str

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

        Returns
        -------
        DashboardPublic
            Dashboard resource

        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.dashboards.get_dashboard_by_id(dashboard_id='dashboardId', )
        asyncio.run(main())
        r<   Nr?   rA   s       r   r@   z)AsyncDashboardsClient.get_dashboard_by_id  s7     6 **>>|]l>mm	~~ n   !646c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)aN  
        Delete dashboard by id

        Parameters
        ----------
        dashboard_id : str

        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.dashboards.delete_dashboard(dashboard_id='dashboardId', )
        asyncio.run(main())
        r<   NrC   rA   s       r   rD   z&AsyncDashboardsClient.delete_dashboard  s7     4 **;;LZi;jj	~~ krc   rE   c          	      z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)a  
        Update dashboard by id. Partial updates are supported - only provided fields will be updated.

        Parameters
        ----------
        dashboard_id : str

        name : typing.Optional[str]

        type : typing.Optional[DashboardUpdatePublicType]

        scope : typing.Optional[DashboardUpdatePublicScope]

        description : typing.Optional[str]

        config : typing.Optional[JsonNodePublic]

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

        Returns
        -------
        DashboardPublic
            Updated dashboard

        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.dashboards.update_dashboard(dashboard_id='dashboardId', )
        asyncio.run(main())
        rE   NrG   rI   s	            r   rH   z&AsyncDashboardsClient.update_dashboard  sO     Z **;;#+ < 
 
	 ~~
r`   rJ   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)aO  
        Delete dashboards batch

        Parameters
        ----------
        ids : typing.Sequence[str]

        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.dashboards.delete_dashboards_batch(ids=['ids'], )
        asyncio.run(main())
        rL   NrM   rO   s       r   rN   z-AsyncDashboardsClient.delete_dashboards_batch  s7     4 **BBs\kBll	~~ mrc   )rP   rQ   rR   r   r   rS   r   r!   rT   rU   rV   rW   r   r   r-   rX   r
   r   r   r   r:   r@   rD   r   r   r	   rH   rY   rN   rZ   r   r   r\   r\     s   S*< S  #;     &*%)%)+/(,(,;?6 ooc"6 ooc"	6
 ooc"6 OOC(6 %6 %6  86 
6z ,0-1486:,0;?= = 	=
 OOC(= ooc*= oo01= 23= __S)=  8= 
=@ X\5;__^5T	> X\5;__^5T	B &*;?=A,026;?66 ooc"	6
 oo786 9:6 __S)6 /6  86 
6r `dooc*=C__^=\	r   r\   )rT   core.client_wrapperr   r   core.request_optionsr   types.dashboard_page_publicr   types.dashboard_publicr   types.json_node_publicr	   types.json_node_writer
   
raw_clientr   r   #types.dashboard_update_public_scoper   "types.dashboard_update_public_typer   types.dashboard_write_scoper   types.dashboard_write_typer   castAnyrX   r   r\   rZ   r   r   <module>rt      s\     G 1 = 4 3 1 E K I < : v{{6::s#@ @FT Tr   