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

        Returns
        -------
        RawJwtSettingsClient
        r   r   s    r   with_raw_responsez#JwtSettingsClient.with_raw_response        r   Nrequest_optionsr   c                R    | j                   j                  |      }|j                  S )a  
        Retrieve JWT settings for the currently active organization.

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

        Returns
        -------
        LsejwtSettings


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.jwt_settings.get()
        r   r   getdatar   r   	_responses      r   r    zJwtSettingsClient.get   s'    . $$(((I	~~r   api_tokens_enabledlegacy_api_tokens_enabledr   api_token_ttl_daysr%   r&   c                X    | j                   j                  ||||      }|j                  S )a#  
        Update JWT settings for the currently active organization.

        Parameters
        ----------
        api_token_ttl_days : int

        api_tokens_enabled : typing.Optional[bool]
            Enable JWT API token authentication for this organization

        legacy_api_tokens_enabled : typing.Optional[bool]
            Enable legacy API token authentication for this organization

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

        Returns
        -------
        LsejwtSettings


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.jwt_settings.update(
            api_token_ttl_days=1,
        )
        r'   r%   r&   r   r   updater!   r   r'   r%   r&   r   r#   s         r   r+   zJwtSettingsClient.update7   s8    P $$++11&?+	 , 
	 ~~r   )__name__
__module____qualname__r   r   propertyr
   r   typingOptionalr   r   r    OMITintboolr+    r   r   r   r      s    O*; O  #7     IM foon&E Q_ < 59;?;?.  . #OOD1	.
 $*??4#8.  8. 
.r   r   c                       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dd	d
edej                  e   dej                  e   dej                  e
   def
dZy)AsyncJwtSettingsClientr   c                &    t        |      | _        y r   )r	   r   r   s     r   r   zAsyncJwtSettingsClient.__init__i   s    4NSr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawJwtSettingsClient
        r   r   s    r   r   z(AsyncJwtSettingsClient.with_raw_responsel   r   r   Nr   r   c                n   K   | j                   j                  |       d{   }|j                  S 7 w)aE  
        Retrieve JWT settings for the currently active organization.

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

        Returns
        -------
        LsejwtSettings


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   Nr   r"   s      r   r    zAsyncJwtSettingsClient.getw   s4     > **...OO	~~ Ps    535r$   r'   r%   r&   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a  
        Update JWT settings for the currently active organization.

        Parameters
        ----------
        api_token_ttl_days : int

        api_tokens_enabled : typing.Optional[bool]
            Enable JWT API token authentication for this organization

        legacy_api_tokens_enabled : typing.Optional[bool]
            Enable legacy API token authentication for this organization

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

        Returns
        -------
        LsejwtSettings


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r)   Nr*   r,   s         r   r+   zAsyncJwtSettingsClient.update   sF     ` **1111&?+	 2 
 
	 ~~
s   #868)r-   r.   r/   r   r   r0   r	   r   r1   r2   r   r   r    r3   r4   r5   r+   r6   r   r   r8   r8   h   s    T*< T  #<     OS  FOON,K  We  L 59;?;?6  6 #OOD1	6
 $*??4#86  86 
6r   r8   )r1   core.client_wrapperr   r   core.request_optionsr   types.lsejwt_settingsr   
raw_clientr	   r
   castAnyr3   r   r8   r6   r   r   <module>rC      sG     G 1 2 G v{{6::s#W Wtg gr   