
    ]j#                         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mZ  e j                  e j                   d
      Z G d d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)ProjectGroupRequest)ScimSettings)ScimSettingsUpdate   )AsyncRawScimClientRawScimClient.c                   p   e Zd ZdefdZedefd       Zdddej                  e
   defdZeeedd	d
ej                  ej                  e      dej                  ej                  ej                  e         dej                  ej                  ej                  e         dej                  e
   def
dZy)
ScimClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     J/root/env/lib/python3.12/site-packages/label_studio_sdk/sso/scim/client.py__init__zScimClient.__init__   s    (G    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawScimClient
        r   r   s    r   with_raw_responsezScimClient.with_raw_response        r   Nrequest_optionsr   c                R    | 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 SCIM settings for the currently active organization.

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

        Returns
        -------
        ScimSettings


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.sso.scim.get()
        r   r   getdatar   r   	_responses      r   r"   zScimClient.get   s'    : $$(((I	~~r   projects_groupsroles_groupsworkspaces_groupsr   r'   r(   r)   c                X    | j                   j                  ||||      }|j                  S )aD  
        <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 SCIM settings for the currently active organization.

        Parameters
        ----------
        projects_groups : typing.Optional[typing.Sequence[ProjectGroupRequest]]
            Projects to Groups Mapping. List of objects with project_id, group, role.

        roles_groups : typing.Optional[typing.Sequence[typing.Sequence[str]]]
            Organization Roles to Groups Mapping. List of [role_name, group_name] pairs.

        workspaces_groups : typing.Optional[typing.Sequence[typing.Sequence[str]]]
            Workspaces to Groups Mapping. List of [workspace_title, group_name] pairs.

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

        Returns
        -------
        ScimSettingsUpdate


        Examples
        --------
        from label_studio_sdk import LabelStudio, ProjectGroupRequest

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.sso.scim.update(
            projects_groups=[
                ProjectGroupRequest(
                    group="groups_test",
                    project_id=42,
                    role="Inherit",
                )
            ],
            roles_groups=[["Administrator", "groups_test"]],
            workspaces_groups=[["Default workspace", "groups_test"]],
        )
        r&   r   updater#   r   r'   r(   r)   r   r%   s         r   r,   zScimClient.update?   s8    n $$+++%/+	 , 
	 ~~r   )__name__
__module____qualname__r   r   propertyr   r   typingOptionalr   r   r"   OMITSequencer   strr	   r,    r   r   r   r      s    H*; H  =     IM foon&E Q] F RVOSTX;?=  9L)MN= oofoofooc6J&KL	=
 "??6??6??3;O+PQ=  8= 
=r   r   c                   p   e Zd ZdefdZedefd       Zdddej                  e
   defdZeeedd	d
ej                  ej                  e      dej                  ej                  ej                  e         dej                  ej                  ej                  e         dej                  e
   def
dZy)AsyncScimClientr   c                &    t        |      | _        y r   )r   r   r   s     r   r   zAsyncScimClient.__init__   s    -^Lr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawScimClient
        r   r   s    r   r   z!AsyncScimClient.with_raw_response   r   r   Nr   r   c                n   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>
        Retrieve SCIM settings for the currently active organization.

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

        Returns
        -------
        ScimSettings


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.sso.scim.get()


        asyncio.run(main())
        r   Nr!   r$   s      r   r"   zAsyncScimClient.get   s5     J **...OO	~~ Ps    535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>
        Update SCIM settings for the currently active organization.

        Parameters
        ----------
        projects_groups : typing.Optional[typing.Sequence[ProjectGroupRequest]]
            Projects to Groups Mapping. List of objects with project_id, group, role.

        roles_groups : typing.Optional[typing.Sequence[typing.Sequence[str]]]
            Organization Roles to Groups Mapping. List of [role_name, group_name] pairs.

        workspaces_groups : typing.Optional[typing.Sequence[typing.Sequence[str]]]
            Workspaces to Groups Mapping. List of [workspace_title, group_name] pairs.

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

        Returns
        -------
        ScimSettingsUpdate


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio, ProjectGroupRequest

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.sso.scim.update(
                projects_groups=[
                    ProjectGroupRequest(
                        group="groups_test",
                        project_id=42,
                        role="Inherit",
                    )
                ],
                roles_groups=[["Administrator", "groups_test"]],
                workspaces_groups=[["Default workspace", "groups_test"]],
            )


        asyncio.run(main())
        r&   Nr+   r-   s         r   r,   zAsyncScimClient.update   sF     ~ **11+%/+	 2 
 
	 ~~
s   #868)r.   r/   r0   r   r   r1   r   r   r2   r3   r   r   r"   r4   r5   r   r6   r	   r,   r7   r   r   r9   r9      s    M*< M  #5     OS &FOON,K &Wc &V RVOSTX;?E  9L)MNE oofoofooc6J&KL	E
 "??6??6??3;O+PQE  8E 
Er   r9   )r2   core.client_wrapperr   r   core.request_optionsr   types.project_group_requestr   types.scim_settingsr   types.scim_settings_updater	   
raw_clientr   r   castAnyr4   r   r9   r7   r   r   <module>rF      sM     H 2 > / < 9 v{{6::s#l l^| |r   