
    ]j                        d dl Zd dlZd dlmZ ddlmZ ddlmZm	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 ddlmZ ddlmZ ddlmZ ddlmZ  ej>                  ej@                  d      Z! G d d      Z" G d d      Z#y)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)jsonable_encoder)RequestOptions)construct_type)Hotkeys)LseUser)
LseUserApi)
WhoAmIUser   )GetTokenUsersResponse)ResetTokenUsersResponse.c                   4   e Zd ZdefdZdddej                  e   dee	   fdZ
eeeeeeeeeeeeddd	ej                  e   d
ej                  e   dej                  ej                     dej                  ej                      dej                  ej                     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   dee	   fdZdddej                  e   dee   fdZedddej                  ej*                  eej                  f      dej                  e   dee   fdZdddej                  e   dee   fdZdddej                  e   dee   fdZdddej                  e   dee   fdZddddej                  e   dej                  e   deej:                  e	      fdZ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   dej                  e   dej                  e   dee   fd$Z ddd"edej                  e   dee   fd%Z!ddd"edej                  e   ded   fd&Z"eeeeeeeeedd'
d"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   dej                  e   dej                  e   dej                  e   dee   fd)Z#y)*RawUsersClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     K/root/env/lib/python3.12/site-packages/label_studio_sdk/users/raw_client.py__init__zRawUsersClient.__init__   
    -    Nrequest_optionsr"   returnc                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY 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>
        Get info about the currently authenticated user.

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

        Returns
        -------
        HttpResponse[LseUserApi]

        api/current-userGETmethodr"      ,  type_object_responsedatastatus_codeheadersbody)r   httpx_clientrequestr2   typingcastr   r   jsonr	   r   r   dictr3   textr   r"   	_response_data_response_jsons        r   get_current_userzRawUsersClient.get_current_user   s    ( ((55==+ > 
	
	ti++1c1"( ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	t   AC C ?D active_organizationallow_newsletterscustom_hotkeysdate_joinedemail_notification_settings
first_nameis_email_verified	last_nameonboarding_statepasswordphoneusernamer"   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   c                2   | j                   j                  j                  dd|||||||||	|
||dddi|t              }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY 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 details for the currently authenticated user.

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

        allow_newsletters : typing.Optional[bool]
            Allow sending newsletters to user

        custom_hotkeys : typing.Optional[typing.Any]
            Custom keyboard shortcuts configuration for the user interface

        date_joined : typing.Optional[dt.datetime]

        email_notification_settings : typing.Optional[typing.Any]

        first_name : typing.Optional[str]

        is_email_verified : typing.Optional[bool]

        last_name : typing.Optional[str]

        onboarding_state : typing.Optional[str]

        password : typing.Optional[str]

        phone : typing.Optional[str]

        username : typing.Optional[str]

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

        Returns
        -------
        HttpResponse[LseUserApi]

        r%   PATCHrC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   content-typeapplication/jsonr(   r9   r3   r"   omitr)   r*   r+   r.   r1   )r   r5   r6   OMITr2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   r"   r=   r>   r?   s                    r   update_current_userz"RawUsersClient.update_current_userD   s!   | ((55==':%6"0*/J(%6&$4$$  2 ,+ > 
	.	ti++1c1"( ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts    AC C ?Dc                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)	a  
        Retrieve the custom hotkeys configuration for the current user.

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

        Returns
        -------
        HttpResponse[Hotkeys]

        api/current-user/hotkeys/r&   r'   r)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r<   s        r   get_hotkeyszRawUsersClient.get_hotkeys   s     ((55=='+ > 
	
	ti++1c1"% ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trA   rE   r"   c                   | j                   j                  j                  ddd|iddi|t              }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)ad  
        Update the custom hotkeys configuration for the current user.

        Parameters
        ----------
        custom_hotkeys : typing.Optional[typing.Dict[str, typing.Any]]

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

        Returns
        -------
        HttpResponse[Hotkeys]

        rZ   rP   rE   rR   rS   rT   r)   r*   r+   r.   r1   )r   r5   r6   rV   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r   rE   r"   r=   r>   r?   s         r   update_hotkeyszRawUsersClient.update_hotkeys   s   * ((55==' .  2 , > 
		ti++1c1"% ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?Dc                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)	a8  
        Reset the user token for the current user.

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

        Returns
        -------
        HttpResponse[ResetTokenUsersResponse]
            User token response
        api/current-user/reset-token/POSTr'   r)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r<   s        r   reset_tokenzRawUsersClient.reset_token   s      ((55==++ > 
	
	ti++1c1+"5 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trA   c                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)	aL  
        Get a user token to authenticate to the API as the current user.

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

        Returns
        -------
        HttpResponse[GetTokenUsersResponse]
            User token response
        api/current-user/tokenr&   r'   r)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r<   s        r   	get_tokenzRawUsersClient.get_token  s      ((55==$+ > 
	
	ti++1c1)"3 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trA   c                   | j                   j                  j                  dd|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)	a'  
        Retrieve details of the account that you are using to access the API.

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

        Returns
        -------
        HttpResponse[WhoAmIUser]

        api/current-user/whoamir&   r'   r)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r<   s        r   whoamizRawUsersClient.whoamiB  s     ((55==%+ > 
	
	ti++1c1"( ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trA   orderingr"   rk   c                P   | j                   j                  j                  ddd|i|      }	 d|j                  cxk  rdk  rin nft	        j
                  t        j                  t           t        t        j                  t           |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w)
a  
        List the users that exist on the Label Studio server.

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

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

        Returns
        -------
        HttpResponse[typing.List[LseUserApi]]

        
api/users/r&   rk   r(   paramsr"   r)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   Listr   r   r9   r	   r   r   r:   r3   r;   r   rk   r"   r=   r>   r?   s         r   listzRawUsersClient.listd  s   & ((55==H , > 
		ti++1c1KK
+"$kk*5 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   A=C& +C& &?D%
rD   avataremailrH   idinitialsrJ   rM   rN   r"   rt   ru   rv   rw   c       
         ,   | j                   j                  j                  dd|||||||||	d	ddi|
t              }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)a  
        Create a user in Label Studio.

        Parameters
        ----------
        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        HttpResponse[LseUser]

        rm   rb   	rD   rt   ru   rH   rv   rw   rJ   rM   rN   rR   rS   rT   r)   r*   r+   r.   r1   )r   r5   r6   rV   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r   rD   rt   ru   rH   rv   rw   rJ   rM   rN   r"   r=   r>   r?   s                 r   createzRawUsersClient.create  s   l ((55==%6 ($&$
  2 ,% > 
	(	ti++1c1"% ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?Dc                    | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w)
aG  
        Get info about a specific Label Studio user, based on the user ID.

        Parameters
        ----------
        id : int
            User ID

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

        Returns
        -------
        HttpResponse[LseUser]

        rm   /r&   r'   r)   r*   r+   r.   r1   )r   r5   r6   r
   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r   rv   r"   r=   r>   r?   s         r   getzRawUsersClient.get  s    " ((55==)"-.a0+ > 
	
	ti++1c1"% ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?Dc                   | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  rn nt        |d      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w)
a  
        Delete a specific Label Studio user. Only available in community edition.

        <Warning>Use caution when deleting a user, as this can cause issues such as breaking the "Annotated by" filter or leaving orphaned records.</Warning>

        Parameters
        ----------
        id : int
            User ID

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

        Returns
        -------
        HttpResponse[None]
        rm   r}   DELETEr'   r)   r*   Nr.   r1   )r   r5   r6   r
   r2   r	   r9   r   r   r:   r3   r;   r   rv   r"   r=   r?   s        r   deletezRawUsersClient.delete  s    $ ((55==)"-.a0+ > 
	
	ti++1c1#YTBB&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   $B B ?C
rD   rt   ru   rH   update_users_request_idrw   rJ   rM   rN   r"   r   c       
         F   | j                   j                  j                  dt        |       dd||||||||	|
d	ddi|t              }	 d|j
                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j
                  t        |j                        |      # t        $ r6 t        |j
                  t        |j                        |j                         w xY w)a$  

                Update details for a specific user, such as their name or contact information, in Label Studio.


        Parameters
        ----------
        id : int
            User ID

        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        update_users_request_id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        HttpResponse[LseUser]

        rm   r}   rP   ry   rR   rS   rT   r)   r*   r+   r.   r1   )r   r5   r6   r
   rV   r2   r7   r8   r   r   r9   r	   r   r   r:   r3   r;   r   rv   rD   rt   ru   rH   r   rw   rJ   rM   rN   r"   r=   r>   r?   s                  r   updatezRawUsersClient.update+  s(   x ((55==)"-.a0%6 (-$&$
  2 ,% > 
	(	ti++1c1"% ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   
AC! &C! !?D )$__name__
__module____qualname__r   r   r7   Optionalr   r	   r   r@   rV   intboolAnydtdatetimestrrX   r   r[   Dictr_   r   rc   r   rf   r   ri   rp   rr   r   r{   r   r   r    r    r   r   r      s   .*; . VZ &p6??>3R &p^jku^v &pV 59376:48CG+/37*.15)-&*)-;?bp $__S1bp "??40	bp
 

3bp __R[[1bp &,__VZZ%@bp OOC(bp "??40bp ??3'bp !//#.bp //#&bp s#bp //#&bp  8bp  
j	!!bpH QU  pfoon.M  pYefmYn  pJ IM;?	.p CO(DE.p  8	.p
 
g	.pb EI"p"(//."A"p	-	."pJ EI"p"(//."A"p	+	,"pH LP  p)H  pT`akTl  pF 37ko(p!??3/(pIOYgIh(p	fkk*-	.(pZ 48'+&*+/#')-*.&*)-;?Wp "??40Wp $	Wp
 s#Wp OOC(Wp OOC Wp //#&Wp ??3'Wp s#Wp //#&Wp  8Wp 
g	Wpr RV #pc #pv~/N #pZfgnZo #pJ UY p p&//.2Q p]ijn]o pF 48'+&*+/8<)-*.&*)-;?]p]p "??40	]p
 $]p s#]p OOC(]p "(!5]p //#&]p ??3']p s#]p //#&]p  8]p 
g	]pr    r   c                   4   e Zd ZdefdZdddej                  e   dee	   fdZ
eeeeeeeeeeeeddd	ej                  e   d
ej                  e   dej                  ej                     dej                  ej                      dej                  ej                     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   dee	   fdZdddej                  e   dee   fdZedddej                  ej*                  eej                  f      dej                  e   dee   fdZdddej                  e   dee   fdZdddej                  e   dee   fdZdddej                  e   dee   fdZddddej                  e   dej                  e   deej:                  e	      fdZ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   dej                  e   dej                  e   dee   fd$Z ddd"edej                  e   dee   fd%Z!ddd"edej                  e   ded   fd&Z"eeeeeeeeedd'
d"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   dej                  e   dej                  e   dej                  e   dee   fd)Z#y)*AsyncRawUsersClientr   c                    || _         y r   r   r   s     r   r   zAsyncRawUsersClient.__init__  r   r    Nr!   r"   r#   c                "  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      7 # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w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>
        Get info about the currently authenticated user.

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

        Returns
        -------
        AsyncHttpResponse[LseUserApi]

        r%   r&   r'   Nr)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r<   s        r   r@   z$AsyncRawUsersClient.get_current_user  s     , ..;;CC+ D 
 
	
	ti++1c1"( ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	t3   ,DCDAC DC  ,D?DDrB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   c                N  K   | j                   j                  j                  dd|||||||||	|
||dddi|t               d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY w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 details for the currently authenticated user.

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

        allow_newsletters : typing.Optional[bool]
            Allow sending newsletters to user

        custom_hotkeys : typing.Optional[typing.Any]
            Custom keyboard shortcuts configuration for the user interface

        date_joined : typing.Optional[dt.datetime]

        email_notification_settings : typing.Optional[typing.Any]

        first_name : typing.Optional[str]

        is_email_verified : typing.Optional[bool]

        last_name : typing.Optional[str]

        onboarding_state : typing.Optional[str]

        password : typing.Optional[str]

        phone : typing.Optional[str]

        username : typing.Optional[str]

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

        Returns
        -------
        AsyncHttpResponse[LseUserApi]

        r%   rP   rQ   rR   rS   rT   Nr)   r*   r+   r.   r1   )r   r5   r6   rV   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   rW   s                    r   rX   z'AsyncRawUsersClient.update_current_user  s1    | ..;;CC':%6"0*/J(%6&$4$$  2 ,+ D 
 
	.	ti++1c1"( ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`nooI
D  	ty'<'<d9K\K\F]dmdrdrss	ts7   AD%C!D%
AC# %D%&C# 6,D%#?D""D%c                "  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      7 # t        $ r6 t        |j                  t        |j                        |j                  	      w xY ww)
a#  
        Retrieve the custom hotkeys configuration for the current user.

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

        Returns
        -------
        AsyncHttpResponse[Hotkeys]

        rZ   r&   r'   Nr)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r<   s        r   r[   zAsyncRawUsersClient.get_hotkeys  s       ..;;CC'+ D 
 
	
	ti++1c1"% ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	tr   r\   c                8  K   | j                   j                  j                  ddd|iddi|t               d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)ai  
        Update the custom hotkeys configuration for the current user.

        Parameters
        ----------
        custom_hotkeys : typing.Optional[typing.Dict[str, typing.Any]]

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

        Returns
        -------
        AsyncHttpResponse[Hotkeys]

        rZ   rP   rE   rR   rS   rT   Nr)   r*   r+   r.   r1   )r   r5   r6   rV   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r^   s         r   r_   z"AsyncRawUsersClient.update_hotkeysA  s    * ..;;CC' .  2 , D 
 
		ti++1c1"% ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo3
.  	ty'<'<d9K\K\F]dmdrdrss	ts3   7DCDAC DC +,D?DDc                "  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      7 # t        $ r6 t        |j                  t        |j                        |j                  	      w xY ww)
a=  
        Reset the user token for the current user.

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

        Returns
        -------
        AsyncHttpResponse[ResetTokenUsersResponse]
            User token response
        ra   rb   r'   Nr)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r<   s        r   rc   zAsyncRawUsersClient.reset_tokenq  s       ..;;CC++ D 
 
	
	ti++1c1+"5 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	tr   c                "  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      7 # t        $ r6 t        |j                  t        |j                        |j                  	      w xY ww)
aQ  
        Get a user token to authenticate to the API as the current user.

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

        Returns
        -------
        AsyncHttpResponse[GetTokenUsersResponse]
            User token response
        re   r&   r'   Nr)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r<   s        r   rf   zAsyncRawUsersClient.get_token  s       ..;;CC$+ D 
 
	
	ti++1c1)"3 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	tr   c                "  K   | j                   j                  j                  dd|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      7 # t        $ r6 t        |j                  t        |j                        |j                  	      w xY ww)
a,  
        Retrieve details of the account that you are using to access the API.

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

        Returns
        -------
        AsyncHttpResponse[WhoAmIUser]

        rh   r&   r'   Nr)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r<   s        r   ri   zAsyncRawUsersClient.whoami  s      ..;;CC%+ D 
 
	
	ti++1c1"( ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	tr   rj   rk   c                l  K   | j                   j                  j                  ddd|i|       d{   }	 d|j                  cxk  rdk  rin nft	        j
                  t        j                  t           t        t        j                  t           |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      7 # t        $ r6 t        |j                  t        |j                        |j                  
      w xY ww)a  
        List the users that exist on the Label Studio server.

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

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

        Returns
        -------
        AsyncHttpResponse[typing.List[LseUserApi]]

        rm   r&   rk   rn   Nr)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   rp   r   r   r9   r   r   r   r:   r3   r;   rq   s         r   rr   zAsyncRawUsersClient.list  s    & ..;;CCH , D 
 
		ti++1c1KK
+"$kk*5 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	ts3   /D4C0D4A=C2 4D45C2 ,D42?D11D4rs   rt   ru   rv   rw   c       
         H  K   | j                   j                  j                  dd|||||||||	d	ddi|
t               d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)a  
        Create a user in Label Studio.

        Parameters
        ----------
        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        AsyncHttpResponse[LseUser]

        rm   rb   ry   rR   rS   rT   Nr)   r*   r+   r.   r1   )r   r5   r6   rV   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   rz   s                 r   r{   zAsyncRawUsersClient.create  s'    l ..;;CC%6 ($&$
  2 ,% D 
 
	(	ti++1c1"% ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`nooC
>  	ty'<'<d9K\K\F]dmdrdrss	ts6   ?D"CD"AC  "D"#C  3,D" ?DD"c                <  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      7 # t        $ r6 t        |j                  t        |j                        |j                  
      w xY ww)aL  
        Get info about a specific Label Studio user, based on the user ID.

        Parameters
        ----------
        id : int
            User ID

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

        Returns
        -------
        AsyncHttpResponse[LseUser]

        rm   r}   r&   r'   Nr)   r*   r+   r.   r1   )r   r5   r6   r
   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r~   s         r   r   zAsyncRawUsersClient.get^  s    & ..;;CC)"-.a0+ D 
 
	
	ti++1c1"% ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	ts4   9DCDAC DC -,D?DDc                  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  rn nt        |d      S |j                         }t        |j                  t        |j                        |	      7 e# t        $ r6 t        |j                  t        |j                        |j                  	      w xY ww)
a  
        Delete a specific Label Studio user. Only available in community edition.

        <Warning>Use caution when deleting a user, as this can cause issues such as breaking the "Annotated by" filter or leaving orphaned records.</Warning>

        Parameters
        ----------
        id : int
            User ID

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

        Returns
        -------
        AsyncHttpResponse[None]
        rm   r}   r   r'   Nr)   r*   r.   r1   )r   r5   r6   r
   r2   r   r9   r   r   r:   r3   r;   r   s        r   r   zAsyncRawUsersClient.delete  s     ( ..;;CC)"-.a0+ D 
 
	
	ti++1c1()$GG&^^-N 9#8#8$yGXGXBY`noo
  	ty'<'<d9K\K\F]dmdrdrss	ts3   9C%B!C%$B# %C%&B# 6,C%#?C""C%r   r   c       
         b  K   | j                   j                  j                  dt        |       dd||||||||	|
d	ddi|t               d{   }	 d	|j
                  cxk  rd
k  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                         }t        |j
                  t        |j                        |      7 # t        $ r6 t        |j
                  t        |j                        |j                         w xY ww)a)  

                Update details for a specific user, such as their name or contact information, in Label Studio.


        Parameters
        ----------
        id : int
            User ID

        allow_newsletters : typing.Optional[bool]
            Whether the user allows newsletters

        avatar : typing.Optional[str]
            Avatar URL of the user

        email : typing.Optional[str]
            Email of the user

        first_name : typing.Optional[str]
            First name of the user

        update_users_request_id : typing.Optional[int]
            User ID

        initials : typing.Optional[str]
            Initials of the user

        last_name : typing.Optional[str]
            Last name of the user

        phone : typing.Optional[str]
            Phone number of the user

        username : typing.Optional[str]
            Username of the user

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

        Returns
        -------
        AsyncHttpResponse[LseUser]

        rm   r}   rP   ry   rR   rS   rT   Nr)   r*   r+   r.   r1   )r   r5   r6   r
   rV   r2   r7   r8   r   r   r9   r   r   r   r:   r3   r;   r   s                  r   r   zAsyncRawUsersClient.update  s7    x ..;;CC)"-.a0%6 (-$&$
  2 ,% D 
 
	(	ti++1c1"% ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`nooC
>  	ty'<'<d9K\K\F]dmdrdrss	ts7   AD/C+D/AC- /D/0C-  ,D/-?D,,D/)$r   r   r   r   r   r7   r   r   r   r   r@   rV   r   r   r   r   r   r   rX   r   r[   r   r_   r   rc   r   rf   r   ri   rp   rr   r   r{   r   r   r   r   r    r   r   r     s   .*< . EI(p"(//."A(p	:	&(pZ 59376:48CG+/37*.15)-&*)-;?bp $__S1bp "??40	bp
 

3bp __R[[1bp &,__VZZ%@bp OOC(bp "??40bp ??3'bp !//#.bp //#&bp s#bp //#&bp  8bp  
:	&!bpJ EI"p"(//."A"p	7	#"pN IM;?	.p CO(DE.p  8	.p
 
7	#.pb EI"p"(//."A"p	2	3"pJ EI"p"(//."A"p	0	1"pH RV  pv~/N  pZklvZw  pF 37ko(p!??3/(pIOYgIh(p	6;;z2	3(pZ 48'+&*+/#')-*.&*)-;?Wp "??40Wp $	Wp
 s#Wp OOC(Wp OOC Wp //#&Wp ??3'Wp s#Wp //#&Wp  8Wp 
7	#Wpt NR%p%p+1??>+J%p	7	#%pP NRpp+1??>+Jp	4	 pJ 48'+&*+/8<)-*.&*)-;?]p]p "??40	]p
 $]p s#]p OOC(]p "(!5]p //#&]p ??3']p s#]p //#&]p  8]p 
7	#]pr    r   )$r   r   r7   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.jsonable_encoderr
   core.request_optionsr   core.unchecked_base_modelr   types.hotkeysr   types.lse_userr   types.lse_user_apir   types.who_am_i_userr   types.get_token_users_responser    types.reset_token_users_responser   r8   r   rV   r   r   r   r    r   <module>r      si      ( % G @ 4 1 6 # $ + , A E v{{6::s#p	p p	pfx	p x	pr    