
    ]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)SessionTimeoutPolicy   )AsyncRawSessionPolicyClientRawSessionPolicyClient.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j                  e   dej                  e   dej                  e
   defdZy)SessionPolicyClientclient_wrapperc                &    t        |      | _        y N)r   )r
   _raw_clientselfr   s     P/root/env/lib/python3.12/site-packages/label_studio_sdk/session_policy/client.py__init__zSessionPolicyClient.__init__   s    1P    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSessionPolicyClient
        r   r   s    r   with_raw_responsez%SessionPolicyClient.with_raw_response        r   Nrequest_optionsr   c                R    | j                   j                  |      }|j                  S )a  
        Retrieve session timeout policy for the currently active organization.

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

        Returns
        -------
        SessionTimeoutPolicy


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.session_policy.get()
        r   r   getdatar   r   	_responses      r   r    zSessionPolicyClient.get   s'    . $$(((I	~~r   max_session_agemax_time_between_activityr   r%   r&   c                V    | j                   j                  |||      }|j                  S )a  
        Update session timeout policy for the currently active organization.

        Parameters
        ----------
        max_session_age : typing.Optional[int]
            Number of minutes that a session can be active before needing to re-login

        max_time_between_activity : typing.Optional[int]
            Number of minutes that a session stays active without any activity

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

        Returns
        -------
        SessionTimeoutPolicy


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.session_policy.update()
        r$   r   updater!   r   r%   r&   r   r#   s        r   r)   zSessionPolicyClient.update7   s5    F $$+++&?+ , 
	
 ~~r   )__name__
__module____qualname__r   r   propertyr
   r   typingOptionalr   r   r    OMITintr)    r   r   r   r      s    Q*; Q  #9     IM foon&E Qe : 15:>;?(  -( $*??3#7	(
  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j                  e   dej                  e   dej                  e
   defdZy)AsyncSessionPolicyClientr   c                &    t        |      | _        y r   )r	   r   r   s     r   r   z!AsyncSessionPolicyClient.__init__c   s    6nUr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSessionPolicyClient
        r   r   s    r   r   z*AsyncSessionPolicyClient.with_raw_responsef   r   r   Nr   r   c                n   K   | j                   j                  |       d{   }|j                  S 7 w)aW  
        Retrieve session timeout policy for the currently active organization.

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

        Returns
        -------
        SessionTimeoutPolicy


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r   Nr   r"   s      r   r    zAsyncSessionPolicyClient.getq   s4     > **...OO	~~ Ps    535r$   r%   r&   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)ag  
        Update session timeout policy for the currently active organization.

        Parameters
        ----------
        max_session_age : typing.Optional[int]
            Number of minutes that a session can be active before needing to re-login

        max_time_between_activity : typing.Optional[int]
            Number of minutes that a session stays active without any activity

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

        Returns
        -------
        SessionTimeoutPolicy


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.session_policy.update()


        asyncio.run(main())
        r$   Nr(   r*   s        r   r)   zAsyncSessionPolicyClient.update   sC     V **11+&?+ 2 
 
	
 ~~
s   "757)r+   r,   r-   r   r   r.   r	   r   r/   r0   r   r   r    r1   r2   r)   r3   r   r   r5   r5   b   s    V*< V  #>     OS  FOON,K  Wk  J 15:>;?0  -0 $*??3#7	0
  80 
0r   r5   )r/   core.client_wrapperr   r   core.request_optionsr   types.session_timeout_policyr   
raw_clientr	   r
   castAnyr1   r   r5   r3   r   r   <module>r@      sG     G 1 ? K v{{6::s#Q Qha ar   