
    ]jEh                         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  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)AnnotationReview.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d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j                      dej                  ej$                     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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j                      dej                  ej$                     dej                  e	   d	e
e   fdZy)RawAnnotationReviewsClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     X/root/env/lib/python3.12/site-packages/label_studio_sdk/annotation_reviews/raw_client.py__init__z#RawAnnotationReviewsClient.__init__   
    -    N
annotationannotation_task_project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 reviews for a specific annotation ID. Only allowed for organizations with reviewing features enabled.

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

        annotation_task_project : typing.Optional[int]

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

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

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

        api/annotation-reviews/GETr   annotation__task__projectr   methodparamsr      ,  type_object_responsedatastatus_codeheadersbody)r   httpx_clientrequestr2   typingcastListr   r   jsonr	   r   r   dictr3   textr   r   r   r   r   	_response_data_response_jsons           r   listzRawAnnotationReviewsClient.list   s
   D ((55==%(-D$
 , > 	
		ti++1c1KK 01"$kk*:; ) 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'async_postprocessacceptedcommentlast_annotation_historyremove_from_queueresult
started_atr   rC   rD   rE   rF   rG   rH   rI   c       	         .   | j                   j                  j                  ddd|i|||||||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)aP  
        <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 review for a specific annotation ID. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        annotation : int
            Corresponding annotation

        async_postprocess : typing.Optional[bool]
            Whether to postprocess the review asynchronously.

        accepted : typing.Optional[bool]
            Accepted or rejected (if false) flag

        comment : typing.Optional[str]

        last_annotation_history : typing.Optional[int]

        remove_from_queue : typing.Optional[bool]

        result : typing.Optional[typing.Any]

        started_at : typing.Optional[dt.datetime]

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

        Returns
        -------
        HttpResponse[AnnotationReview]

        r"   POSTrC   rD   r   rE   rF   rG   rH   rI   content-typeapplication/jsonr'   r(   r:   r3   r   omitr)   r*   r+   r.   r1   )r   r5   r6   OMITr2   r7   r8   r   r   r:   r	   r   r   r;   r3   r<   r   r   rC   rD   rE   rF   rG   rH   rI   r   r>   r?   r@   s                r   createz!RawAnnotationReviewsClient.createR   s   f ((55==%#%6 %("+B%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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 a specific review by ID for an annotation. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        id : int
            A unique integer value identifying this annotation review.

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

        Returns
        -------
        HttpResponse[AnnotationReview]

        r"   /r#   r'   r   r)   r*   r+   r.   r1   )r   r5   r6   r
   r2   r7   r8   r   r   r:   r	   r   r   r;   r3   r<   r   rU   r   r>   r?   r@   s         r   getzRawAnnotationReviewsClient.get   s    2 ((55==%&6r&:%;1=+ > 
	
	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 review by ID. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        id : int
            A unique integer value identifying this annotation review.

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

        Returns
        -------
        HttpResponse[None]
        r"   rW   DELETErX   r)   r*   Nr.   r1   )r   r5   r6   r
   r2   r	   r:   r   r   r;   r3   r<   r   rU   r   r>   r@   s        r   deletez!RawAnnotationReviewsClient.delete   s    , ((55==%&6r&:%;1=+ > 
	
	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   r   rE   rF   rG   rH   rI   r   c                B   | 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 a specific review by ID. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        id : int
            A unique integer value identifying this annotation review.

        accepted : typing.Optional[bool]
            Accepted or rejected (if false) flag

        annotation : typing.Optional[int]
            Corresponding annotation

        comment : typing.Optional[str]

        last_annotation_history : typing.Optional[int]

        remove_from_queue : typing.Optional[bool]

        result : typing.Optional[typing.Any]

        started_at : typing.Optional[dt.datetime]

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

        Returns
        -------
        HttpResponse[AnnotationReview]

        r"   rW   PATCHrL   rM   rN   r'   r:   r3   r   rP   r)   r*   r+   r.   r1   )r   r5   r6   r
   rQ   r2   r7   r8   r   r   r:   r	   r   r   r;   r3   r<   r   rU   rD   r   rE   rF   rG   rH   rI   r   r>   r?   r@   s                r   updatez!RawAnnotationReviewsClient.update   s"   f ((55==%&6r&:%;1=$("+B%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   Optionalintstrr   r	   r9   r   rA   rQ   boolAnydtdatetimerS   rZ   r^   rd    r   r   r   r      s   .*; . ,08<)-;?9p OOC(9p "(!5	9p
 //#&9p  89p 
fkk"23	49p~ 48*.(,8<37.237;?Up Up "??40	Up
 //$'Up %Up "(!5Up "??40Up 

+Up OOBKK0Up  8Up 
&	'Upp NR+p+p+1??>+J+p	&	'+pZ UY !p !p&//.2Q !p]ijn]o !pN +/+/(,8<37.237;?RpRp //$'	Rp
 OOC(Rp %Rp "(!5Rp "??40Rp 

+Rp OOBKK0Rp  8Rp 
&	'R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d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j                      dej                  ej$                     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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j                      dej                  ej$                     dej                  e	   d	e
e   fdZy)AsyncRawAnnotationReviewsClientr   c                    || _         y r   r   r   s     r   r   z(AsyncRawAnnotationReviewsClient.__init__O  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 reviews for a specific annotation ID. Only allowed for organizations with reviewing features enabled.

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

        annotation_task_project : typing.Optional[int]

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

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

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

        r"   r#   r$   r&   Nr)   r*   r+   r.   r1   )r   r5   r6   r2   r7   r8   r9   r   r   r:   r   r   r   r;   r3   r<   r=   s           r   rA   z$AsyncRawAnnotationReviewsClient.listR  s    D ..;;CC%(-D$
 , D 	
 	
		ti++1c1KK 01"$kk*:; ) 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rB   rC   rD   rE   rF   rG   rH   rI   c       	         J  K   | j                   j                  j                  ddd|i|||||||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)aU  
        <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 review for a specific annotation ID. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        annotation : int
            Corresponding annotation

        async_postprocess : typing.Optional[bool]
            Whether to postprocess the review asynchronously.

        accepted : typing.Optional[bool]
            Accepted or rejected (if false) flag

        comment : typing.Optional[str]

        last_annotation_history : typing.Optional[int]

        remove_from_queue : typing.Optional[bool]

        result : typing.Optional[typing.Any]

        started_at : typing.Optional[dt.datetime]

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

        Returns
        -------
        AsyncHttpResponse[AnnotationReview]

        r"   rK   rC   rL   rM   rN   rO   Nr)   r*   r+   r.   r1   )r   r5   r6   rQ   r2   r7   r8   r   r   r:   r   r   r   r;   r3   r<   rR   s                r   rS   z&AsyncRawAnnotationReviewsClient.create  s/    f ..;;CC%#%6 %("+B%6 (  2 ,' D 
 
	*	ti++1c1$". ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`nooE
@  	ty'<'<d9K\K\F]dmdrdrss	ts7   A D#CD#AC! #D#$C! 4,D#!?D  D#rT   rU   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 a specific review by ID for an annotation. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        id : int
            A unique integer value identifying this annotation review.

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

        Returns
        -------
        AsyncHttpResponse[AnnotationReview]

        r"   rW   r#   rX   Nr)   r*   r+   r.   r1   )r   r5   r6   r
   r2   r7   r8   r   r   r:   r   r   r   r;   r3   r<   rY   s         r   rZ   z#AsyncRawAnnotationReviewsClient.get  s    2 ..;;CC%&6r&:%;1=+ 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 review by ID. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        id : int
            A unique integer value identifying this annotation review.

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

        Returns
        -------
        AsyncHttpResponse[None]
        r"   rW   r\   rX   Nr)   r*   r.   r1   )r   r5   r6   r
   r2   r   r:   r   r   r;   r3   r<   r]   s        r   r^   z&AsyncRawAnnotationReviewsClient.delete  s     0 ..;;CC%&6r&:%;1=+ 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                ^  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 a specific review by ID. Only allowed for organizations with reviewing features enabled.

        Parameters
        ----------
        id : int
            A unique integer value identifying this annotation review.

        accepted : typing.Optional[bool]
            Accepted or rejected (if false) flag

        annotation : typing.Optional[int]
            Corresponding annotation

        comment : typing.Optional[str]

        last_annotation_history : typing.Optional[int]

        remove_from_queue : typing.Optional[bool]

        result : typing.Optional[typing.Any]

        started_at : typing.Optional[dt.datetime]

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

        Returns
        -------
        AsyncHttpResponse[AnnotationReview]

        r"   rW   ra   rL   rM   rN   rb   Nr)   r*   r+   r.   r1   )r   r5   r6   r
   rQ   r2   r7   r8   r   r   r:   r   r   r   r;   r3   r<   rc   s                r   rd   z&AsyncRawAnnotationReviewsClient.update6  s0    f ..;;CC%&6r&:%;1=$("+B%6 (  2 ,! 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s7   A
D-C)D-AC+ -D-.C+ >,D-+?D**D-)re   rf   rg   r   r   r7   rh   ri   rj   r   r   r9   r   rA   rQ   rk   rl   rm   rn   rS   rZ   r^   rd   ro   r   r   rq   rq   N  s   .*< . ,08<)-;?9p OOC(9p "(!5	9p
 //#&9p  89p 
6;;'78	99p~ 48*.(,8<37.237;?Up Up "??40	Up
 //$'Up %Up "(!5Up "??40Up 

+Up OOBKK0Up  8Up 
+	,Upp NR+p+p+1??>+J+p	+	,+p\ NR#p#p+1??>+J#p	4	 #pR +/+/(,8<37.237;?RpRp //$'	Rp
 OOC(Rp %Rp "(!5Rp "??40Rp 

+Rp OOBKK0Rp  8Rp 
+	,Rpr   rq   )rn   rm   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.annotation_reviewr   r8   rl   rQ   r   rq   ro   r   r   <module>r      sZ      ( % G @ 4 1 6 6 v{{6::s#xp xpv	zp zpr   