
    ]jb                         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  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)	Workspace.c                      e Zd ZdefdZddddddej                  e   dej                  e   dej                  e   dej                  e	   d	e
ej                  e      f
d
Z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
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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
e   fdZy)RawWorkspacesClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     P/root/env/lib/python3.12/site-packages/label_studio_sdk/workspaces/raw_client.py__init__zRawWorkspacesClient.__init__   
    -    Ninclude_all_workspacesis_personalorderingrequest_optionsr   r   r   r   returnc                T   | j                   j                  j                  dd|||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                        |	      # 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>
        List all workspaces for your organization. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        include_all_workspaces : typing.Optional[bool]
            Include all workspaces in the organization, including other users' personal workspaces. Only effective for users with Administrator or Owner role. When enabled, the response includes created_by_user info for personal workspaces.

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace.

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

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

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

        api/workspaces/GETr   r   r   methodparamsr      ,  type_object_responsedatastatus_codeheadersbody)r   httpx_clientrequestr1   typingcastListr   r   jsonr	   r   r   dictr2   textr   r   r   r   r   	_response_data_response_jsons           r   listzRawWorkspacesClient.list   s   H ((55==*@*$
 , > 	
		ti++1c1KK	*"$kk)4 ) 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'colordescriptionis_archivedr   r   titlerB   rC   rD   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)av  
        <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>
        Create a new workspace. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        title : str
            Workspace Name

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

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

        Returns
        -------
        HttpResponse[Workspace]

        r"   POSTrB   rC   rD   r   rE   content-typeapplication/jsonr&   r9   r2   r   omitr(   r)   r*   r-   r0   )r   r4   r5   OMITr1   r6   r7   r   r   r9   r	   r   r   r:   r2   r;   
r   rE   rB   rC   rD   r   r   r=   r>   r?   s
             r   createzRawWorkspacesClient.createS   s   X ((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r   idc                    | 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)
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 details for a specific workspace by ID.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        HttpResponse[Workspace]

        r"   /r#   r&   r   r(   r)   r*   r-   r0   )r   r4   r5   r
   r1   r6   r7   r   r   r9   r	   r   r   r:   r2   r;   r   rQ   r   r=   r>   r?   s         r   getzRawWorkspacesClient.get   s    , ((55==.r231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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  
        <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>
        Delete a specific workspace by ID.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        HttpResponse[None]
        r"   rS   DELETErT   r(   r)   Nr-   r0   )r   r4   r5   r
   r1   r	   r9   r   r   r:   r2   r;   r   rQ   r   r=   r?   s        r   deletezRawWorkspacesClient.delete   s    * ((55==.r2315+ > 
	
	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rB   rC   rD   r   rE   r   c          
      >   | 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  
        <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 settings for a specific workspace by ID.

        Parameters
        ----------
        id : int

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

        title : typing.Optional[str]
            Workspace Name

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

        Returns
        -------
        HttpResponse[Workspace]

        r"   rS   PATCHrH   rI   rJ   rK   r(   r)   r*   r-   r0   )r   r4   r5   r
   rM   r1   r6   r7   r   r   r9   r	   r   r   r:   r2   r;   r   rQ   rB   rC   rD   r   rE   r   r=   r>   r?   s              r   updatezRawWorkspacesClient.update   s   ^ ((55==.r231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)__name__
__module____qualname__r   r   r6   Optionalboolstrr   r	   r8   r   r@   rM   rO   intrV   rZ   r_    r   r   r   r      sL   .*; . 9=-1)-;?;p !' 5;p __T*	;p
 //#&;p  8;p 
fkk),	-;pB '+,0-1-1;?Ip Ip s#	Ip
 __S)Ip __T*Ip __T*Ip  8Ip 
i	 IpV RV (pc (pv~/N (pZfgpZq (pT UY  p  p&//.2Q  p]ijn]o  pL '+,0-1-1&*;?LpLp s#	Lp
 __S)Lp __T*Lp __T*Lp s#Lp  8Lp 
i	 Lpr   r   c                      e Zd ZdefdZddddddej                  e   dej                  e   dej                  e   dej                  e	   d	e
ej                  e      f
d
Z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
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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
e   fdZy)AsyncRawWorkspacesClientr   c                    || _         y r   r   r   s     r   r   z!AsyncRawWorkspacesClient.__init__:  r   r   Nr   r   r   r   r   r    c                p  K   | j                   j                  j                  dd|||d|       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#  
        <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>
        List all workspaces for your organization. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        include_all_workspaces : typing.Optional[bool]
            Include all workspaces in the organization, including other users' personal workspaces. Only effective for users with Administrator or Owner role. When enabled, the response includes created_by_user info for personal workspaces.

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace.

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

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

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

        r"   r#   r$   r%   Nr(   r)   r*   r-   r0   )r   r4   r5   r1   r6   r7   r8   r   r   r9   r   r   r   r:   r2   r;   r<   s           r   r@   zAsyncRawWorkspacesClient.list=  s    H ..;;CC*@*$
 , D 	
 	
		ti++1c1KK	*"$kk)4 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo/	
*  	ty'<'<d9K\K\F]dmdrdrss	ts3   1D6C2D6A=C4 6D67C4 ,D64?D33D6rA   rE   rB   rC   rD   c          
      @  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>
        Create a new workspace. Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization. For more information, see the [Workspaces documentation](https://docs.humansignal.com/workspaces).

        Parameters
        ----------
        title : str
            Workspace Name

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

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

        Returns
        -------
        AsyncHttpResponse[Workspace]

        r"   rG   rH   rI   rJ   rK   Nr(   r)   r*   r-   r0   )r   r4   r5   rM   r1   r6   r7   r   r   r9   r   r   r   r:   r2   r;   rN   s
             r   rO   zAsyncRawWorkspacesClient.createz  s    X ..;;CC***  2 , D 
 
	 	ti++1c1"' ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo;
6  	ty'<'<d9K\K\F]dmdrdrss	ts4   ;DCDAC DC /,D?DDrP   rQ   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)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 details for a specific workspace by ID.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        AsyncHttpResponse[Workspace]

        r"   rS   r#   rT   Nr(   r)   r*   r-   r0   )r   r4   r5   r
   r1   r6   r7   r   r   r9   r   r   r   r:   r2   r;   rU   s         r   rV   zAsyncRawWorkspacesClient.get  s    0 ..;;CC.r2315+ 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  
        <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>
        Delete a specific workspace by ID.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        AsyncHttpResponse[None]
        r"   rS   rX   rT   Nr(   r)   r-   r0   )r   r4   r5   r
   r1   r   r9   r   r   r:   r2   r;   rY   s        r   rZ   zAsyncRawWorkspacesClient.delete  s     . ..;;CC.r2315+ 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[   c          
      Z  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  
        <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 settings for a specific workspace by ID.

        Parameters
        ----------
        id : int

        color : typing.Optional[str]
            Color

        description : typing.Optional[str]
            Workspace description

        is_archived : typing.Optional[bool]
            Workspace is archived

        is_personal : typing.Optional[bool]
            Workspace is a personal user workspace

        title : typing.Optional[str]
            Workspace Name

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

        Returns
        -------
        AsyncHttpResponse[Workspace]

        r"   rS   r]   rH   rI   rJ   rK   Nr(   r)   r*   r-   r0   )r   r4   r5   r
   rM   r1   r6   r7   r   r   r9   r   r   r   r:   r2   r;   r^   s              r   r_   zAsyncRawWorkspacesClient.update  s*    ^ ..;;CC.r2315***  2 , D 
 
	 	ti++1c1"' ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo;
6  	ty'<'<d9K\K\F]dmdrdrss	ts7   AD+
C'D+AC) +D+,C) <,D+)?D((D+)r`   ra   rb   r   r   r6   rc   rd   re   r   r   r8   r   r@   rM   rO   rf   rV   rZ   r_   rg   r   r   ri   ri   9  sN   .*< . 9=-1)-;?;p !' 5;p __T*	;p
 //#&;p  8;p 
6;;y1	2;pB '+,0-1-1;?Ip Ip s#	Ip
 __S)Ip __T*Ip __T*Ip  8Ip 
9	%IpX NR*p*p+1??>+J*p	9	%*pZ NR"p"p+1??>+J"p	4	 "pP '+,0-1-1&*;?LpLp s#	Lp
 __S)Lp __T*Lp __T*Lp s#Lp  8Lp 
9	%Lpr   ri   )r6   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.jsonable_encoderr
   core.request_optionsr   core.unchecked_base_modelr   types.workspacer   r7   AnyrM   r   ri   rg   r   r   <module>ry      sW     ( % G @ 4 1 6 ' v{{6::s#dp dpN	hp hpr   