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

import typing
import uuid

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from .raw_client import AsyncRawTransformationsClient, RawTransformationsClient
from .types.transcript_summary_response import TranscriptSummaryResponse

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


class TransformationsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawTransformationsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawTransformationsClient
        """
        return self._raw_client

    def generate_summary(
        self,
        transcription_id_: uuid.UUID,
        *,
        transcription_id: uuid.UUID,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TranscriptSummaryResponse:
        """
        Generate a Markdown summary for a transcription. If a summary already exists, it is returned.

        Parameters
        ----------
        transcription_id_ : uuid.UUID
            ID of the transcription to summarize

        transcription_id : uuid.UUID
            ID of the transcription to summarize

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

        Returns
        -------
        TranscriptSummaryResponse

        Examples
        --------
        import uuid

        from soferai import SoferAI

        client = SoferAI(
            api_key="YOUR_API_KEY",
        )
        client.transformations.generate_summary(
            transcription_id_=uuid.UUID(
                "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
            ),
            transcription_id=uuid.UUID(
                "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
            ),
        )
        """
        _response = self._raw_client.generate_summary(
            transcription_id_, transcription_id=transcription_id, request_options=request_options
        )
        return _response.data

    def get_summary(
        self, transcription_id: uuid.UUID, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TranscriptSummaryResponse:
        """
        Get the Markdown summary for a transcription if it exists.

        Parameters
        ----------
        transcription_id : uuid.UUID
            ID of the transcription to fetch summary for

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

        Returns
        -------
        TranscriptSummaryResponse

        Examples
        --------
        import uuid

        from soferai import SoferAI

        client = SoferAI(
            api_key="YOUR_API_KEY",
        )
        client.transformations.get_summary(
            transcription_id=uuid.UUID(
                "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
            ),
        )
        """
        _response = self._raw_client.get_summary(transcription_id, request_options=request_options)
        return _response.data


class AsyncTransformationsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawTransformationsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawTransformationsClient
        """
        return self._raw_client

    async def generate_summary(
        self,
        transcription_id_: uuid.UUID,
        *,
        transcription_id: uuid.UUID,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TranscriptSummaryResponse:
        """
        Generate a Markdown summary for a transcription. If a summary already exists, it is returned.

        Parameters
        ----------
        transcription_id_ : uuid.UUID
            ID of the transcription to summarize

        transcription_id : uuid.UUID
            ID of the transcription to summarize

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

        Returns
        -------
        TranscriptSummaryResponse

        Examples
        --------
        import asyncio
        import uuid

        from soferai import AsyncSoferAI

        client = AsyncSoferAI(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.transformations.generate_summary(
                transcription_id_=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
                transcription_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.generate_summary(
            transcription_id_, transcription_id=transcription_id, request_options=request_options
        )
        return _response.data

    async def get_summary(
        self, transcription_id: uuid.UUID, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TranscriptSummaryResponse:
        """
        Get the Markdown summary for a transcription if it exists.

        Parameters
        ----------
        transcription_id : uuid.UUID
            ID of the transcription to fetch summary for

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

        Returns
        -------
        TranscriptSummaryResponse

        Examples
        --------
        import asyncio
        import uuid

        from soferai import AsyncSoferAI

        client = AsyncSoferAI(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.transformations.get_summary(
                transcription_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
            )


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