# 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.number_from_string import NumberFromString
from .raw_client import AsyncRawAnnotationsClient, RawAnnotationsClient
from .types.annotations_create_request_label import AnnotationsCreateRequestLabel
from .types.annotations_create_response import AnnotationsCreateResponse
from .types.annotations_get_response import AnnotationsGetResponse
from .types.annotations_list_request_label import AnnotationsListRequestLabel
from .types.annotations_list_response import AnnotationsListResponse
from .types.annotations_update_request_label import AnnotationsUpdateRequestLabel
from .types.annotations_update_response import AnnotationsUpdateResponse

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


class AnnotationsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAnnotationsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawAnnotationsClient
        """
        return self._raw_client

    def list(
        self,
        *,
        otel_trace_id: typing.Optional[str] = None,
        otel_span_id: typing.Optional[str] = None,
        label: typing.Optional[AnnotationsListRequestLabel] = None,
        limit: typing.Optional[NumberFromString] = None,
        offset: typing.Optional[NumberFromString] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AnnotationsListResponse:
        """
        Parameters
        ----------
        otel_trace_id : typing.Optional[str]

        otel_span_id : typing.Optional[str]

        label : typing.Optional[AnnotationsListRequestLabel]

        limit : typing.Optional[NumberFromString]

        offset : typing.Optional[NumberFromString]

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

        Returns
        -------
        AnnotationsListResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.annotations.list()
        """
        _response = self._raw_client.list(
            otel_trace_id=otel_trace_id,
            otel_span_id=otel_span_id,
            label=label,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    def create(
        self,
        *,
        otel_span_id: str,
        otel_trace_id: str,
        label: typing.Optional[AnnotationsCreateRequestLabel] = OMIT,
        reasoning: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AnnotationsCreateResponse:
        """
        Parameters
        ----------
        otel_span_id : str

        otel_trace_id : str

        label : typing.Optional[AnnotationsCreateRequestLabel]

        reasoning : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

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

        Returns
        -------
        AnnotationsCreateResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.annotations.create(
            otel_span_id="otelSpanId",
            otel_trace_id="otelTraceId",
        )
        """
        _response = self._raw_client.create(
            otel_span_id=otel_span_id,
            otel_trace_id=otel_trace_id,
            label=label,
            reasoning=reasoning,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AnnotationsGetResponse:
        """
        Parameters
        ----------
        id : str

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

        Returns
        -------
        AnnotationsGetResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.annotations.get(
            id="id",
        )
        """
        _response = self._raw_client.get(id, request_options=request_options)
        return _response.data

    def update(
        self,
        id: str,
        *,
        label: typing.Optional[AnnotationsUpdateRequestLabel] = OMIT,
        reasoning: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AnnotationsUpdateResponse:
        """
        Parameters
        ----------
        id : str

        label : typing.Optional[AnnotationsUpdateRequestLabel]

        reasoning : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

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

        Returns
        -------
        AnnotationsUpdateResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.annotations.update(
            id="id",
        )
        """
        _response = self._raw_client.update(
            id, label=label, reasoning=reasoning, metadata=metadata, request_options=request_options
        )
        return _response.data

    def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Parameters
        ----------
        id : str

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

        Returns
        -------
        None

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.annotations.delete(
            id="id",
        )
        """
        _response = self._raw_client.delete(id, request_options=request_options)
        return _response.data


class AsyncAnnotationsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAnnotationsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawAnnotationsClient
        """
        return self._raw_client

    async def list(
        self,
        *,
        otel_trace_id: typing.Optional[str] = None,
        otel_span_id: typing.Optional[str] = None,
        label: typing.Optional[AnnotationsListRequestLabel] = None,
        limit: typing.Optional[NumberFromString] = None,
        offset: typing.Optional[NumberFromString] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AnnotationsListResponse:
        """
        Parameters
        ----------
        otel_trace_id : typing.Optional[str]

        otel_span_id : typing.Optional[str]

        label : typing.Optional[AnnotationsListRequestLabel]

        limit : typing.Optional[NumberFromString]

        offset : typing.Optional[NumberFromString]

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

        Returns
        -------
        AnnotationsListResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


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


        asyncio.run(main())
        """
        _response = await self._raw_client.list(
            otel_trace_id=otel_trace_id,
            otel_span_id=otel_span_id,
            label=label,
            limit=limit,
            offset=offset,
            request_options=request_options,
        )
        return _response.data

    async def create(
        self,
        *,
        otel_span_id: str,
        otel_trace_id: str,
        label: typing.Optional[AnnotationsCreateRequestLabel] = OMIT,
        reasoning: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AnnotationsCreateResponse:
        """
        Parameters
        ----------
        otel_span_id : str

        otel_trace_id : str

        label : typing.Optional[AnnotationsCreateRequestLabel]

        reasoning : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

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

        Returns
        -------
        AnnotationsCreateResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.annotations.create(
                otel_span_id="otelSpanId",
                otel_trace_id="otelTraceId",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            otel_span_id=otel_span_id,
            otel_trace_id=otel_trace_id,
            label=label,
            reasoning=reasoning,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AnnotationsGetResponse:
        """
        Parameters
        ----------
        id : str

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

        Returns
        -------
        AnnotationsGetResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.annotations.get(
                id="id",
            )


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

    async def update(
        self,
        id: str,
        *,
        label: typing.Optional[AnnotationsUpdateRequestLabel] = OMIT,
        reasoning: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AnnotationsUpdateResponse:
        """
        Parameters
        ----------
        id : str

        label : typing.Optional[AnnotationsUpdateRequestLabel]

        reasoning : typing.Optional[str]

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

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

        Returns
        -------
        AnnotationsUpdateResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.annotations.update(
                id="id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            id, label=label, reasoning=reasoning, metadata=metadata, request_options=request_options
        )
        return _response.data

    async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Parameters
        ----------
        id : str

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.annotations.delete(
                id="id",
            )


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