
    ]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)SamlSettings)SamlSettingsUpdate   )AsyncRawSamlClientRawSamlClient.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eeeeeee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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)
SamlClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     J/root/env/lib/python3.12/site-packages/label_studio_sdk/sso/saml/client.py__init__zSamlClient.__init__   s    (G    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSamlClient
        r   r   s    r   with_raw_responsezSamlClient.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 SAML2 settings for the currently active organization.

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

        Returns
        -------
        SamlSettings


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.sso.saml.get()
        r   r   getdatar   r   	_responses      r   r"   zSamlClient.get   s'    : $$(((I	~~r   domainmapping_emailmapping_first_namemapping_groupsmapping_last_namemetadata_urlmetadata_xmlprojects_groupsroles_groupsworkspaces_groupsr   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   c                f    | 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>
        Update SAML2 settings for the currently active organization.

        Parameters
        ----------
        domain : typing.Optional[str]
            Organization web domain or domains; use comma separated list with no spaces for multiple. Example:<br><br>labelstud.io,humansignal.com<br><br>IMPORTANT: DO NOT PUT COMMON DOMAINS LIKE GMAIL.COM, YAHOO.COM, ETC. IN THIS FIELD

        mapping_email : typing.Optional[str]
            Mapping attributes: user email from SAML request

        mapping_first_name : typing.Optional[str]
            Mapping attributes: user first name from SAML request

        mapping_groups : typing.Optional[str]
            Mapping attributes: groups attribute for user mapping to workspaces and roles

        mapping_last_name : typing.Optional[str]
            Mapping attributes: user last name from SAML request

        metadata_url : typing.Optional[str]
            URL SAML metadata from IdP

        metadata_xml : typing.Optional[str]
            Metadata XML file

        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
        -------
        SamlSettingsUpdate


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.sso.saml.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+   r,   r-   r.   r/   r0   r   r%   s                r   r3   zSamlClient.update?   sM    f $$++'1)/%%+%/+ , 
	 ~~r   )__name__
__module____qualname__r   r   propertyr   r   typingOptionalr   r   r"   OMITstrSequencer   r	   r3    r   r   r   r      s   H*; H  =     IM foon&E Q] F (,.237/326-1-1QUOSTX;?` $` s+	`
 #OOC0` ,` "??3/` ooc*` ooc*`  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eeeeeee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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)AsyncSamlClientr   c                &    t        |      | _        y r   )r   r   r   s     r   r   zAsyncSamlClient.__init__   s    -^Lr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSamlClient
        r   r   s    r   r   z!AsyncSamlClient.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 SAML2 settings for the currently active organization.

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

        Returns
        -------
        SamlSettings


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   Nr!   r$   s      r   r"   zAsyncSamlClient.get   s5     J **...OO	~~ Ps    535r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   c                   K   | j                   j                  |||||||||	|
|       d{   }|j                  S 7 w)aj  
        <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 SAML2 settings for the currently active organization.

        Parameters
        ----------
        domain : typing.Optional[str]
            Organization web domain or domains; use comma separated list with no spaces for multiple. Example:<br><br>labelstud.io,humansignal.com<br><br>IMPORTANT: DO NOT PUT COMMON DOMAINS LIKE GMAIL.COM, YAHOO.COM, ETC. IN THIS FIELD

        mapping_email : typing.Optional[str]
            Mapping attributes: user email from SAML request

        mapping_first_name : typing.Optional[str]
            Mapping attributes: user first name from SAML request

        mapping_groups : typing.Optional[str]
            Mapping attributes: groups attribute for user mapping to workspaces and roles

        mapping_last_name : typing.Optional[str]
            Mapping attributes: user last name from SAML request

        metadata_url : typing.Optional[str]
            URL SAML metadata from IdP

        metadata_xml : typing.Optional[str]
            Metadata XML file

        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
        -------
        SamlSettingsUpdate


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio, ProjectGroupRequest

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.sso.saml.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&   Nr2   r4   s                r   r3   zAsyncSamlClient.update   s[     v **11'1)/%%+%/+ 2 
 
	 ~~
s   *?=?)r5   r6   r7   r   r   r8   r   r   r9   r:   r   r   r"   r;   r<   r=   r   r	   r3   r>   r   r   r@   r@      s   M*< M  #5     OS &FOON,K &Wc &V (,.237/326-1-1QUOSTX;?h $h s+	h
 #OOC0h ,h "??3/h ooc*h ooc*h  9L)MNh oofoofooc6J&KLh "??6??6??3;O+PQh  8h 
hr   r@   )r9   core.client_wrapperr   r   core.request_optionsr   types.project_group_requestr   types.saml_settingsr   types.saml_settings_updater	   
raw_clientr   r   castAnyr;   r   r@   r>   r   r   <module>rM      sM     H 2 > / < 9 v{{6::s#O Od_ _r   