# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.annotation_queue_write import AnnotationQueueWrite
from .raw_client import AsyncRawAnnotationQueuesClient, RawAnnotationQueuesClient

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class AnnotationQueuesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAnnotationQueuesClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawAnnotationQueuesClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawAnnotationQueuesClient
        """
        return self._raw_client

    def add_items_to_annotation_queue(
        self, id: str, *, ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Add traces or threads to annotation queue

        Parameters
        ----------
        id : str

        ids : typing.Sequence[str]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.annotation_queues.add_items_to_annotation_queue(id='id', ids=['ids'], )
        """
        _response = self._raw_client.add_items_to_annotation_queue(id, ids=ids, request_options=request_options)
        return _response.data

    def create_annotation_queue_batch(
        self,
        *,
        annotation_queues: typing.Sequence[AnnotationQueueWrite],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Create multiple annotation queues for human annotation workflows

        Parameters
        ----------
        annotation_queues : typing.Sequence[AnnotationQueueWrite]
            List of annotation queues to create

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import AnnotationQueueWrite
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.annotation_queues.create_annotation_queue_batch(annotation_queues=[AnnotationQueueWrite(project_id='project_id', name='name', scope="trace", )], )
        """
        _response = self._raw_client.create_annotation_queue_batch(
            annotation_queues=annotation_queues, request_options=request_options
        )
        return _response.data

    def remove_items_from_annotation_queue(
        self, id: str, *, ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Remove items from annotation queue

        Parameters
        ----------
        id : str

        ids : typing.Sequence[str]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.annotation_queues.remove_items_from_annotation_queue(id='id', ids=['ids'], )
        """
        _response = self._raw_client.remove_items_from_annotation_queue(id, ids=ids, request_options=request_options)
        return _response.data


class AsyncAnnotationQueuesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAnnotationQueuesClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawAnnotationQueuesClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawAnnotationQueuesClient
        """
        return self._raw_client

    async def add_items_to_annotation_queue(
        self, id: str, *, ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Add traces or threads to annotation queue

        Parameters
        ----------
        id : str

        ids : typing.Sequence[str]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.annotation_queues.add_items_to_annotation_queue(id='id', ids=['ids'], )
        asyncio.run(main())
        """
        _response = await self._raw_client.add_items_to_annotation_queue(id, ids=ids, request_options=request_options)
        return _response.data

    async def create_annotation_queue_batch(
        self,
        *,
        annotation_queues: typing.Sequence[AnnotationQueueWrite],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Create multiple annotation queues for human annotation workflows

        Parameters
        ----------
        annotation_queues : typing.Sequence[AnnotationQueueWrite]
            List of annotation queues to create

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import AnnotationQueueWrite
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.annotation_queues.create_annotation_queue_batch(annotation_queues=[AnnotationQueueWrite(project_id='project_id', name='name', scope="trace", )], )
        asyncio.run(main())
        """
        _response = await self._raw_client.create_annotation_queue_batch(
            annotation_queues=annotation_queues, request_options=request_options
        )
        return _response.data

    async def remove_items_from_annotation_queue(
        self, id: str, *, ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Remove items from annotation queue

        Parameters
        ----------
        id : str

        ids : typing.Sequence[str]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.annotation_queues.remove_items_from_annotation_queue(id='id', ids=['ids'], )
        asyncio.run(main())
        """
        _response = await self._raw_client.remove_items_from_annotation_queue(
            id, ids=ids, request_options=request_options
        )
        return _response.data
