
    ]jw4                         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)ProjectRole)Role9E7Enum   )AsyncRawRolesClientRawRolesClient.c                   v   e Zd ZdefdZedefd       Zdddddej                  e
   dej                  e   d	ej                  e   dej                  e   fd
Zddde
dede
d	ej                  e   de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j                  e   fdZy)RolesClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     P/root/env/lib/python3.12/site-packages/label_studio_sdk/projects/roles/client.py__init__zRolesClient.__init__   s    )H    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawRolesClient
        r   r   s    r   with_raw_responsezRolesClient.with_raw_response        r   Nidsorderingrequest_optionsr   r   r    c                V    | j                   j                  |||      }|j                  S )an  
        <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 project roles for requested IDs for the current user


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

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

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

        Returns
        -------
        typing.List[ProjectRole]


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.roles.list()
        r   r   listdatar   r   r   r    	_responses        r   r#   zRolesClient.list   s-    T $$))cHVe)f	~~r   r    projectroleuserc                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>

                Create project role for user allowing the user the same access level provided by organization role.


        Parameters
        ----------
        project : int

        role : Role9E7Enum

        user : int

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

        Returns
        -------
        ProjectRole
            Role created

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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.roles.add(
            project=1,
            role="OW",
            user=1,
        )
        r(   r)   r*   r    r   addr$   r   r(   r)   r*   r    r&   s         r   r.   zRolesClient.addK   s/    V $$((t$`o(p	~~r   idc                T    | j                   j                  ||      }|j                  S )am  
        <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>

                Remove project role for user allowing the user the same access level provided by organization role.


        Parameters
        ----------
        id : int
            A unique integer value identifying this project role.

        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.projects.roles.remove(
            id=1,
        )
        r'   r   remover$   r   r0   r    r&   s       r   r3   zRolesClient.removey   s*    F $$++B+P	~~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>

                List users and their project level roles for a given project.
                If user is not listed here and is a member of the project then they would behave as assigned role in organization.


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

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

        Returns
        -------
        typing.List[ProjectRole]


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.roles.get(
            id=1,
        )
        r'   r   getr$   r4   s       r   r7   zRolesClient.get   s*    H $$((_(M	~~r   )__name__
__module____qualname__r   r   propertyr   r   typingOptionalintstrr   Listr   r#   r   r.   r3   r7    r   r   r   r      s+   I*; I  >     %))-;?+ __S!+ //#&	+
  8+ 
[	!+\ qu,,%0,8;,NToo^lNm,	,\ UY $ $&//.2Q $]a $L RV %c %v~/N %Z`ZeZefqZr %r   r   c                   v   e Zd ZdefdZedefd       Zdddddej                  e
   dej                  e   d	ej                  e   dej                  e   fd
Zddde
dede
d	ej                  e   de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j                  e   fdZy)AsyncRolesClientr   c                &    t        |      | _        y r   )r
   r   r   s     r   r   zAsyncRolesClient.__init__   s    .nMr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawRolesClient
        r   r   s    r   r   z"AsyncRolesClient.with_raw_response   r   r   Nr   r   r   r    c                r   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 project roles for requested IDs for the current user


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

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

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

        Returns
        -------
        typing.List[ProjectRole]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   Nr"   r%   s        r   r#   zAsyncRolesClient.list   s:     d **//C(\k/ll	~~ ms   "757r'   r(   r)   r*   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>

                Create project role for user allowing the user the same access level provided by organization role.


        Parameters
        ----------
        project : int

        role : Role9E7Enum

        user : int

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

        Returns
        -------
        ProjectRole
            Role created

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.roles.add(
                project=1,
                role="OW",
                user=1,
            )


        asyncio.run(main())
        r,   Nr-   r/   s         r   r.   zAsyncRolesClient.add  s=     f **..wTPTfu.vv	~~ ws   #868r0   c                p   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>

                Remove project role for user allowing the user the same access level provided by organization role.


        Parameters
        ----------
        id : int
            A unique integer value identifying this project role.

        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.projects.roles.remove(
                id=1,
            )


        asyncio.run(main())
        r'   Nr2   r4   s       r   r3   zAsyncRolesClient.removeA  s7     V **11"o1VV	~~ W   !646c                p   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 users and their project level roles for a given project.
                If user is not listed here and is a member of the project then they would behave as assigned role in organization.


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

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

        Returns
        -------
        typing.List[ProjectRole]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r'   Nr6   r4   s       r   r7   zAsyncRolesClient.geto  s7     \ **..r?.SS	~~ TrI   )r8   r9   r:   r   r   r;   r
   r   r<   r=   r>   r?   r   r@   r   r#   r   r.   r3   r7   rA   r   r   rC   rC      s+   N*< N  #6     %))-;?3 __S!3 //#&	3
  83 
[	!3l qu44%048;4NToo^lNm4	4l [_ ,s ,8W ,cg ,^ NR//+1??>+J/	[	!/r   rC   )r<   core.client_wrapperr   r   core.request_optionsr   types.project_roler   types.role9e7enumr   
raw_clientr
   r   castAnyOMITr   rC   rA   r   r   <module>rS      sJ     H 2 - , ; v{{6::s#u upW Wr   