
    ]j8                         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	m
Z
 ddlmZ dd	lmZ  e j                  e j                   d
      Z G d d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)View   )AsyncRawViewsClientRawViewsClient)CreateViewsRequestData)UpdateViewsRequestData.c                   j   e Zd ZdefdZedefd       Zddddej                  e
   dej                  e   dej                  e   fd	Zeedd
dej                  e   dej                  e
   dej                  e   defdZdddej$                  e
   de
dej                  e   ddfdZddde
dej                  e   dd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dd
dedej                  e   dej                  e
   dej                  e   def
dZy)ViewsClientclient_wrapperc                &    t        |      | _        y N)r   )r
   _raw_clientselfr   s     G/root/env/lib/python3.12/site-packages/label_studio_sdk/views/client.py__init__zViewsClient.__init__   s    )H    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawViewsClient
        r   r   s    r   with_raw_responsezViewsClient.with_raw_response        r   Nprojectrequest_optionsr   r    c                T    | j                   j                  ||      }|j                  S )a  
        List all views for a specific project.

        Parameters
        ----------
        project : typing.Optional[int]
            Project ID

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

        Returns
        -------
        typing.List[View]


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.views.list()
        r   r   listdatar   r   r    	_responses       r   r#   zViewsClient.list   s)    8 $$))'?)[	~~r   r$   r   r    r$   c                V    | j                   j                  |||      }|j                  S )aF  
        Create a view for a specific project.

        Parameters
        ----------
        data : typing.Optional[CreateViewsRequestData]
            Custom view data

        project : typing.Optional[int]
            Project ID

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

        Returns
        -------
        View


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.views.create()
        r'   r   creater$   r   r$   r   r    r&   s        r   r*   zViewsClient.create>   s-    F $$++wXg+h	~~r   r    idsc                V    | j                   j                  |||      }|j                  S )a}  
        Update the order field of views based on the provided list of view IDs

        Parameters
        ----------
        ids : typing.Sequence[int]
            A list of view IDs in the desired order.

        project : int

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

        Returns
        -------
        None

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.views.update_order(
            ids=[1],
            project=1,
        )
        r-   r   r    r   update_orderr$   r   r-   r   r    r&   s        r   r1   zViewsClient.update_orderd   s-    @ $$11c7\k1l	~~r   c                T    | j                   j                  ||      }|j                  S )a  
        Delete all views for a specific project.

        Parameters
        ----------
        project : int
            Project ID

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

        Returns
        -------
        None

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.views.delete_all(
            project=1,
        )
        r   r   
delete_allr$   r%   s       r   r5   zViewsClient.delete_all   s*    6 $$//Q`/a	~~r   idc                T    | j                   j                  ||      }|j                  S )a  
        Get the details about a specific view in the data manager

        Parameters
        ----------
        id : str
            View ID

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

        Returns
        -------
        View


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.views.get(
            id="id",
        )
        r,   r   getr$   r   r6   r    r&   s       r   r9   zViewsClient.get   s)    8 $$((_(M	~~r   c                T    | j                   j                  ||      }|j                  S )a  
        Delete a specific view by ID.

        Parameters
        ----------
        id : str
            View ID

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

        Returns
        -------
        None

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.views.delete(
            id="id",
        )
        r,   r   deleter$   r:   s       r   r=   zViewsClient.delete   s)    6 $$++B+P	~~r   c                X    | j                   j                  ||||      }|j                  S )a  
        Update view data with additional filters and other information for a specific project.

        Parameters
        ----------
        id : str
            View ID

        data : typing.Optional[UpdateViewsRequestData]
            Custom view data

        project : typing.Optional[int]
            Project ID

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

        Returns
        -------
        View


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.views.update(
            id="id",
        )
        r'   r   updater$   r   r6   r$   r   r    r&   s         r   r@   zViewsClient.update   s/    R $$++BT7\k+l	~~r   )__name__
__module____qualname__r   r   propertyr
   r   typingOptionalintr   Listr   r#   OMITr   r*   Sequencer1   r5   strr9   r=   r   r@    r   r   r   r      s   I*; I  >     26jn //#.HNXfHg	T	D 9=(,;?$ oo45$ %	$
  8$ 
$N nr!ooc*!58!KQ??[iKj!	!F ^b S 6??>;Z fj < RV c v~/N Z^ > UY  &//.2Q ]a D 9=(,;?** oo45	*
 %*  8* 
*r   r   c                   j   e Zd ZdefdZedefd       Zddddej                  e
   dej                  e   dej                  e   fd	Zeedd
dej                  e   dej                  e
   dej                  e   defdZdddej$                  e
   de
dej                  e   ddfdZddde
dej                  e   dd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dd
dedej                  e   dej                  e
   dej                  e   def
dZy)AsyncViewsClientr   c                &    t        |      | _        y r   )r	   r   r   s     r   r   zAsyncViewsClient.__init__  s    .nMr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawViewsClient
        r   r   s    r   r   z"AsyncViewsClient.with_raw_response  r   r   Nr   r   r    c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)ak  
        List all views for a specific project.

        Parameters
        ----------
        project : typing.Optional[int]
            Project ID

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

        Returns
        -------
        typing.List[View]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.views.list()


        asyncio.run(main())
        r   Nr"   r%   s       r   r#   zAsyncViewsClient.list  s8     H **//Q`/aa	~~ b   !646r'   r$   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Create a view for a specific project.

        Parameters
        ----------
        data : typing.Optional[CreateViewsRequestData]
            Custom view data

        project : typing.Optional[int]
            Project ID

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

        Returns
        -------
        View


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.views.create()


        asyncio.run(main())
        r'   Nr)   r+   s        r   r*   zAsyncViewsClient.createE  s:     V **11tW^m1nn	~~ o   "757r,   r-   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Update the order field of views based on the provided list of view IDs

        Parameters
        ----------
        ids : typing.Sequence[int]
            A list of view IDs in the desired order.

        project : int

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.views.update_order(
                ids=[1],
                project=1,
            )


        asyncio.run(main())
        r/   Nr0   r2   s        r   r1   zAsyncViewsClient.update_orders  s:     P **77Cbq7rr	~~ srU   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a|  
        Delete all views for a specific project.

        Parameters
        ----------
        project : int
            Project ID

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.views.delete_all(
                project=1,
            )


        asyncio.run(main())
        r   Nr4   r%   s       r   r5   zAsyncViewsClient.delete_all  s8     F **55gWf5gg	~~ hrS   r6   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a}  
        Get the details about a specific view in the data manager

        Parameters
        ----------
        id : str
            View ID

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

        Returns
        -------
        View


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.views.get(
                id="id",
            )


        asyncio.run(main())
        r,   Nr8   r:   s       r   r9   zAsyncViewsClient.get  s7     H **..r?.SS	~~ TrS   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)ac  
        Delete a specific view by ID.

        Parameters
        ----------
        id : str
            View ID

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.views.delete(
                id="id",
            )


        asyncio.run(main())
        r,   Nr<   r:   s       r   r=   zAsyncViewsClient.delete  s7     F **11"o1VV	~~ WrS   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a1  
        Update view data with additional filters and other information for a specific project.

        Parameters
        ----------
        id : str
            View ID

        data : typing.Optional[UpdateViewsRequestData]
            Custom view data

        project : typing.Optional[int]
            Project ID

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

        Returns
        -------
        View


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.views.update(
                id="id",
            )


        asyncio.run(main())
        r'   Nr?   rA   s         r   r@   zAsyncViewsClient.update  s<     b **11"4bq1rr	~~ ss   #868)rB   rC   rD   r   r   rE   r	   r   rF   rG   rH   r   rI   r   r#   rJ   r   r*   rK   r1   r5   rL   r9   r=   r   r@   rM   r   r   rO   rO     s   N*< N  #6     26jn% //#.%HNXfHg%	T	%T 9=(,;?, oo45, %	,
  8, 
,^ nr)ooc*)58)KQ??[iKj)	)V dh $3 $Q_A` $lp $L X\ %C %V__^5T %`d %N [_ $s $8W $cg $T 9=(,;?22 oo45	2
 %2  82 
2r   rO   )rF   core.client_wrapperr   r   core.request_optionsr   
types.viewr   
raw_clientr	   r
   types.create_views_request_datar   types.update_views_request_datar   castAnyrJ   r   rO   rM   r   r   <module>rc      sM     G 1  ; C C v{{6::s#| |~t tr   