
    ]j1                         d dl Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZmZ dd	lmZ  G d
 d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)AnnotationHistory)PaginatedAnnotationHistoryList   )AsyncRawAnnotationHistoryClientRawAnnotationHistoryClient)DeleteAnnotationHistoryResponsec                      e Zd ZdefdZedefd       Zdddddej                  e
   dej                  e   d	ej                  e   dej                  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f
dZddddde
dej                  e
   dej                  e
   d	ej                  e   def
dZy)AnnotationHistoryClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     T/root/env/lib/python3.12/site-packages/label_studio_sdk/annotation_history/client.py__init__z AnnotationHistoryClient.__init__   s    5^T    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawAnnotationHistoryClient
        r   r   s    r   with_raw_responsez)AnnotationHistoryClient.with_raw_response        r   N
annotationorderingrequest_optionsr   r    r!   c                V    | j                   j                  |||      }|j                  S )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 annotation history items for an annotation. Annotation history logs all actions performed with annotations, such as: imports, submits, updates, reviews, and more. Users can view annotation history items in the Annotation History panel during labeling.

        Parameters
        ----------
        annotation : typing.Optional[int]
            Annotation ID to get annotation history items for.

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

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

        Returns
        -------
        typing.List[AnnotationHistory]


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.annotation_history.list()
        r   r   listdatar   r   r    r!   	_responses        r   r$   zAnnotationHistoryClient.list   s-    R $$))Z(ds)t	~~r   r   projecttaskr!   r)   r*   c                X    | j                   j                  ||||      }|j                  S )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 all annotation history items for a specific annotation, task or project. This method is available only for users with administrator roles.

        Parameters
        ----------
        annotation : typing.Optional[int]
            Annotation ID to delete annotation history items for.

        project : typing.Optional[int]
            Project ID to delete annotation history items for.

        task : typing.Optional[int]
            Task ID to delete annotation history items for.

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

        Returns
        -------
        DeleteAnnotationHistoryResponse
            Returns a dict containing the count of removed items.

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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.annotation_history.delete()
        r(   r   deleter%   r   r   r)   r*   r!   r'   s         r   r-   zAnnotationHistoryClient.deleteH   s5    Z $$++!7 , 
	 ~~r   page	page_sizer!   idr0   r1   c                X    | j                   j                  ||||      }|j                  S )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 annotation history items for the project with pagination.

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

        page : typing.Optional[int]
            A page number within the paginated result set.

        page_size : typing.Optional[int]
            Number of results to return per page.

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

        Returns
        -------
        PaginatedAnnotationHistoryList


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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.annotation_history.list_for_project(
            id=1,
        )
        r/   r   list_for_projectr%   r   r2   r0   r1   r!   r'   s         r   r5   z(AnnotationHistoryClient.list_for_projectz   s5    \ $$55TY 6 
	 ~~r   )__name__
__module____qualname__r   r   propertyr   r   typingOptionalintstrr   Listr   r$   r   r-   r   r5    r   r   r   r      sP   U*; U  #=     ,0)-;?* OOC(* //#&	*
  8* 
&	'*^ ,0(,%);?0 OOC(0 %	0
 ooc"0  80 
)0l &**.;?11 ooc"	1
 ??3'1  81 
(1r   r   c                      e Zd ZdefdZedefd       Zdddddej                  e
   dej                  e   d	ej                  e   dej                  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f
dZddddde
dej                  e
   dej                  e
   d	ej                  e   def
dZy)AsyncAnnotationHistoryClientr   c                &    t        |      | _        y r   )r
   r   r   s     r   r   z%AsyncAnnotationHistoryClient.__init__   s    :.Yr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawAnnotationHistoryClient
        r   r   s    r   r   z.AsyncAnnotationHistoryClient.with_raw_response   r   r   Nr   r   r    r!   c                r   K   | j                   j                  |||       d{   }|j                  S 7 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 annotation history items for an annotation. Annotation history logs all actions performed with annotations, such as: imports, submits, updates, reviews, and more. Users can view annotation history items in the Annotation History panel during labeling.

        Parameters
        ----------
        annotation : typing.Optional[int]
            Annotation ID to get annotation history items for.

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

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

        Returns
        -------
        typing.List[AnnotationHistory]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.annotation_history.list()


        asyncio.run(main())
        r   Nr#   r&   s        r   r$   z!AsyncAnnotationHistoryClient.list   sA     b **//!Ho 0 
 
	 ~~
s   "757r(   r)   r*   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 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 all annotation history items for a specific annotation, task or project. This method is available only for users with administrator roles.

        Parameters
        ----------
        annotation : typing.Optional[int]
            Annotation ID to delete annotation history items for.

        project : typing.Optional[int]
            Project ID to delete annotation history items for.

        task : typing.Optional[int]
            Task ID to delete annotation history items for.

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

        Returns
        -------
        DeleteAnnotationHistoryResponse
            Returns a dict containing the count of removed items.

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.annotation_history.delete()


        asyncio.run(main())
        r(   Nr,   r.   s         r   r-   z#AsyncAnnotationHistoryClient.delete   sC     j **11!7 2 
 
	 ~~
   #868r/   r2   r0   r1   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 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 annotation history items for the project with pagination.

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

        page : typing.Optional[int]
            A page number within the paginated result set.

        page_size : typing.Optional[int]
            Number of results to return per page.

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

        Returns
        -------
        PaginatedAnnotationHistoryList


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.annotation_history.list_for_project(
                id=1,
            )


        asyncio.run(main())
        r/   Nr4   r6   s         r   r5   z-AsyncAnnotationHistoryClient.list_for_project-  sC     l **;;TY < 
 
	 ~~
rG   )r7   r8   r9   r   r   r:   r
   r   r;   r<   r=   r>   r   r?   r   r$   r   r-   r   r5   r@   r   r   rB   rB      sP   Z*< Z  #B     ,0)-;?4 OOC(4 //#&	4
  84 
&	'4r ,0(,%);?8 OOC(8 %	8
 ooc"8  88 
)8| &**.;?99 ooc"	9
 ??3'9  89 
(9r   rB   )r;   core.client_wrapperr   r   core.request_optionsr   types.annotation_historyr   'types.paginated_annotation_history_listr   
raw_clientr
   r   (types.delete_annotation_history_responser   r   rB   r@   r   r   <module>rO      s5     G 1 8 T S U^ ^Bx xr   