
    ]jT                        d dl mZ 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 ej                  rdd	lmZmZ dd
lmZmZ  ej(                  ej*                  d      Z G d d      Z G d d      Zy)    )annotationsN   )AsyncClientWrapperSyncClientWrapper)RequestOptions)	Workspace   )AsyncRawWorkspacesClientRawWorkspacesClient)AsyncMembersClientMembersClient)AsyncProjectsClientProjectsClient.c                      e Zd ZddZedd       Zddddd	 	 	 	 	 	 	 	 	 ddZeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdddd	Z	dddd
Z
eeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZed        Zed        Zy)WorkspacesClientc               P    t        |      | _        || _        d | _        d | _        y Nclient_wrapper)r   _raw_client_client_wrapper_members	_projectsselfr   s     L/root/env/lib/python3.12/site-packages/label_studio_sdk/workspaces/client.py__init__zWorkspacesClient.__init__   s%    .nM-8<:>    c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawWorkspacesClient
        r   r   s    r   with_raw_responsez"WorkspacesClient.with_raw_response        r   Ninclude_all_workspacesis_personalorderingrequest_optionsc               X    | j                   j                  ||||      }|j                  S )a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        List all workspaces for your organization. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        include_all_workspaces : typing.Optional[bool]
            Include all workspaces in the organization, including other users' personal workspaces. Only effective for users with Administrator or Owner role. When enabled, the response includes created_by_user info for personal workspaces.

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace.

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

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

        Returns
        -------
        typing.List[Workspace]


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.workspaces.list()
        r$   r   listdatar   r%   r&   r'   r(   	_responses         r   r+   zWorkspacesClient.list%   s8    Z $$))#9#+	 * 
	 ~~r   colordescriptionis_archivedr&   r(   c               \    | j                   j                  ||||||      }|j                  S )aP  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Create a new workspace. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        title : str
            Workspace Name

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

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

        Returns
        -------
        Workspace


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.workspaces.create(
            title="title",
        )
        titler0   r1   r2   r&   r(   r   creater,   r   r5   r0   r1   r2   r&   r(   r.   s           r   r7   zWorkspacesClient.createZ   s>    n $$++###+ , 
	 ~~r   r(   c               T    | j                   j                  ||      }|j                  S )a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Retrieve details for a specific workspace by ID.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        Workspace


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.workspaces.get(
            id=1,
        )
        r9   r   getr,   r   idr(   r.   s       r   r<   zWorkspacesClient.get   s*    B $$((_(M	~~r   c               T    | j                   j                  ||      }|j                  S )a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Delete a specific workspace by ID.

        Parameters
        ----------
        id : 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.workspaces.delete(
            id=1,
        )
        r9   r   deleter,   r=   s       r   rA   zWorkspacesClient.delete   s*    @ $$++B+P	~~r   r0   r1   r2   r&   r5   r(   c          	     ^    | j                   j                  |||||||      }|j                  S )ae  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Update settings for a specific workspace by ID.

        Parameters
        ----------
        id : int

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

        title : typing.Optional[str]
            Workspace Name

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

        Returns
        -------
        Workspace


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.workspaces.update(
            id=1,
        )
        rB   r   updater,   	r   r>   r0   r1   r2   r&   r5   r(   r.   s	            r   rE   zWorkspacesClient.update   sA    t $$++###+ , 
	 ~~r   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr	   )r   r   )r   members.clientr   r   )r   r   s     r   memberszWorkspacesClient.members'  s+    == 5)9M9MNDM}}r   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr	   )r   r   )r   projects.clientr   r   )r   r   s     r   projectszWorkspacesClient.projects/  s+    >>!7+4;O;OPDN~~r   )r   r   )returnr   
r%   typing.Optional[bool]r&   rO   r'   typing.Optional[str]r(   typing.Optional[RequestOptions]rM   ztyping.List[Workspace]r5   strr0   rP   r1   rP   r2   rO   r&   rO   r(   rQ   rM   r   r>   intr(   rQ   rM   r   r>   rU   r(   rQ   rM   Noner>   rU   r0   rP   r1   rP   r2   rO   r&   rO   r5   rP   r(   rQ   rM   r   __name__
__module____qualname__r   propertyr"   r+   OMITr7   r<   rA   rE   rI   rL    r   r   r   r      sq   ?     9=-1)-;?3 !63 +	3
 '3 93 
 3r '+,0-1-1;?? ? $	?
 *? +? +? 9? 
?B RV "H UY !N '+,0-1-1&*;?CC $	C
 *C +C +C $C 9C 
CJ    r   r   c                      e Zd ZddZedd       Zddddd	 	 	 	 	 	 	 	 	 ddZeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdddd	Z	dddd
Z
eeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZed        Zed        Zy)AsyncWorkspacesClientc               P    t        |      | _        || _        d | _        d | _        y r   )r
   r   r   r   r   r   s     r   r   zAsyncWorkspacesClient.__init__9  s%    3>R-=A?Cr   c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawWorkspacesClient
        r    r!   s    r   r"   z'AsyncWorkspacesClient.with_raw_response?  r#   r   Nr$   c               t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a@  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        List all workspaces for your organization. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        include_all_workspaces : typing.Optional[bool]
            Include all workspaces in the organization, including other users' personal workspaces. Only effective for users with Administrator or Owner role. When enabled, the response includes created_by_user info for personal workspaces.

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace.

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

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

        Returns
        -------
        typing.List[Workspace]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r$   Nr*   r-   s         r   r+   zAsyncWorkspacesClient.listJ  sF     j **//#9#+	 0 
 
	 ~~
s   #868r/   c               x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Create a new workspace. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        title : str
            Workspace Name

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

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

        Returns
        -------
        Workspace


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.workspaces.create(
                title="title",
            )


        asyncio.run(main())
        r4   Nr6   r8   s           r   r7   zAsyncWorkspacesClient.create  sL     ~ **11###+ 2 
 
	 ~~
s   %:8:r9   c               p   K   | j                   j                  ||       d{   }|j                  S 7 w)ac  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Retrieve details for a specific workspace by ID.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        Workspace


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r9   Nr;   r=   s       r   r<   zAsyncWorkspacesClient.get  s7     R **..r?.SS	~~ T   !646c               p   K   | j                   j                  ||       d{   }|j                  S 7 w)aR  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Delete a specific workspace by ID.

        Parameters
        ----------
        id : 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.workspaces.delete(
                id=1,
            )


        asyncio.run(main())
        r9   Nr@   r=   s       r   rA   zAsyncWorkspacesClient.delete  s7     P **11"o1VV	~~ Wrg   rB   c          	     z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Update settings for a specific workspace by ID.

        Parameters
        ----------
        id : int

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

        title : typing.Optional[str]
            Workspace Name

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

        Returns
        -------
        Workspace


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        rB   NrD   rF   s	            r   rE   zAsyncWorkspacesClient.update'  sO     D **11###+ 2 
 
	 ~~
s   &;9;c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr	   )r   r   )r   rH   r   r   )r   r   s     r   rI   zAsyncWorkspacesClient.memberst  s+    == :.d>R>RSDM}}r   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr	   )r   r   )r   rK   r   r   )r   r   s     r   rL   zAsyncWorkspacesClient.projects|  s+    >>!<0@T@TUDN~~r   )r   r   )rM   r
   rN   rR   rT   rV   rX   rY   r_   r   r   ra   ra   8  sz   D     9=-1)-;?; !6; +	;
 '; 9; 
 ;B '+,0-1-1;?G G $	G
 *G +G +G 9G 
GR X\ *X [_ )^ '+,0-1-1&*;?KK $	K
 *K +K +K $K 9K 
KZ    r   ra   )
__future__r   typingcore.client_wrapperr   r   core.request_optionsr   types.workspacer   
raw_clientr
   r   TYPE_CHECKINGrH   r   r   rK   r   r   castAnyr^   r   ra   r_   r   r   <module>ru      sW    #  G 1 ' E	ADv{{6::s#b bJ	J Jr   