# 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.lse_key_indicator_value import LseKeyIndicatorValue
from .raw_client import AsyncRawIndicatorsClient, RawIndicatorsClient
from .types.list_indicators_response_item import ListIndicatorsResponseItem


class IndicatorsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawIndicatorsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawIndicatorsClient
        """
        return self._raw_client

    def list(
        self, id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ListIndicatorsResponseItem]:
        """
        <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 key indicators for the Prompt dashboard.

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

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

        Returns
        -------
        typing.List[ListIndicatorsResponseItem]
            Key indicators

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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.prompts.indicators.list(
            id=1,
        )
        """
        _response = self._raw_client.list(id, request_options=request_options)
        return _response.data

    def get(
        self, id: int, indicator_key: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LseKeyIndicatorValue:
        """
        <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 a specific key indicator for the Prompt dashboard.

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

        indicator_key : str

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

        Returns
        -------
        LseKeyIndicatorValue
            Key indicator

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

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.prompts.indicators.get(
            id=1,
            indicator_key="indicator_key",
        )
        """
        _response = self._raw_client.get(id, indicator_key, request_options=request_options)
        return _response.data


class AsyncIndicatorsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawIndicatorsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawIndicatorsClient
        """
        return self._raw_client

    async def list(
        self, id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ListIndicatorsResponseItem]:
        """
        <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 key indicators for the Prompt dashboard.

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

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

        Returns
        -------
        typing.List[ListIndicatorsResponseItem]
            Key indicators

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.prompts.indicators.list(
                id=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list(id, request_options=request_options)
        return _response.data

    async def get(
        self, id: int, indicator_key: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LseKeyIndicatorValue:
        """
        <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 a specific key indicator for the Prompt dashboard.

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

        indicator_key : str

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

        Returns
        -------
        LseKeyIndicatorValue
            Key indicator

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.prompts.indicators.get(
                id=1,
                indicator_key="indicator_key",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get(id, indicator_key, request_options=request_options)
        return _response.data
