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

import typing

from .. import core
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from .raw_client import AsyncRawAudioClient, RawAudioClient

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


class AudioClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAudioClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawAudioClient
        """
        return self._raw_client

    def list_transcriptions(
        self,
        *,
        status: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        List all transcriptions with pagination and filtering

        Parameters
        ----------
        status : typing.Optional[str]

        limit : typing.Optional[int]

        offset : typing.Optional[int]

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.list_transcriptions()
        """
        _response = self._raw_client.list_transcriptions(
            status=status, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def get_transcription(
        self,
        transcription_id: str,
        *,
        if_none_match: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Get transcription details by ID with conditional polling

        Parameters
        ----------
        transcription_id : str

        if_none_match : typing.Optional[str]

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.get_transcription(
            transcription_id="transcription_id",
        )
        """
        _response = self._raw_client.get_transcription(
            transcription_id, if_none_match=if_none_match, request_options=request_options
        )
        return _response.data

    def delete_transcription(
        self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Dict[str, typing.Any]:
        """
        Delete transcription by ID (soft delete with upstream deletion)

        Parameters
        ----------
        transcription_id : str

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.delete_transcription(
            transcription_id="transcription_id",
        )
        """
        _response = self._raw_client.delete_transcription(transcription_id, request_options=request_options)
        return _response.data

    def search_transcript(
        self, transcription_id: str, *, query: str, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Search transcript for matching segments (stub endpoint for Phase 1)

        Parameters
        ----------
        transcription_id : str

        query : str
            Search query string

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

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.search_transcript(
            transcription_id="transcription_id",
            query="query",
        )
        """
        _response = self._raw_client.search_transcript(transcription_id, query=query, request_options=request_options)
        return _response.data

    def get_redacted_audio(
        self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Get audio with PII redacted (stub endpoint for Phase 1)

        Parameters
        ----------
        transcription_id : str

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

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.get_redacted_audio(
            transcription_id="transcription_id",
        )
        """
        _response = self._raw_client.get_redacted_audio(transcription_id, request_options=request_options)
        return _response.data

    def upload_audio_file(self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Upload audio file for transcription (stub endpoint for Phase 1)

        Parameters
        ----------
        file : core.File
            See core.File for more documentation

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

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.upload_audio_file()
        """
        _response = self._raw_client.upload_audio_file(file=file, request_options=request_options)
        return _response.data

    def get_paragraphs(
        self,
        transcription_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Get transcript organized into paragraphs with timestamps

        Parameters
        ----------
        transcription_id : str

        limit : typing.Optional[int]
            Max paragraphs to return

        offset : typing.Optional[int]
            Number of paragraphs to skip

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.get_paragraphs(
            transcription_id="transcription_id",
        )
        """
        _response = self._raw_client.get_paragraphs(
            transcription_id, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def get_sentences(
        self,
        transcription_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Get transcript organized into sentences with timestamps

        Parameters
        ----------
        transcription_id : str

        limit : typing.Optional[int]
            Max sentences to return

        offset : typing.Optional[int]
            Number of sentences to skip

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.get_sentences(
            transcription_id="transcription_id",
        )
        """
        _response = self._raw_client.get_sentences(
            transcription_id, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    def get_subtitles(
        self,
        transcription_id: str,
        format: str,
        *,
        chars_per_caption: typing.Optional[int] = None,
        max_lines: typing.Optional[int] = None,
        max_chars_per_line: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Get transcript in subtitle format (srt, vtt, txt)

        Parameters
        ----------
        transcription_id : str

        format : str

        chars_per_caption : typing.Optional[int]
            Max characters per caption (0 = no limit)

        max_lines : typing.Optional[int]
            Max lines per caption

        max_chars_per_line : typing.Optional[int]
            Max characters per line

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

        Returns
        -------
        typing.Any
            Subtitle content in requested format

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.audio.get_subtitles(
            transcription_id="transcription_id",
            format="format",
        )
        """
        _response = self._raw_client.get_subtitles(
            transcription_id,
            format,
            chars_per_caption=chars_per_caption,
            max_lines=max_lines,
            max_chars_per_line=max_chars_per_line,
            request_options=request_options,
        )
        return _response.data


class AsyncAudioClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAudioClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawAudioClient
        """
        return self._raw_client

    async def list_transcriptions(
        self,
        *,
        status: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        List all transcriptions with pagination and filtering

        Parameters
        ----------
        status : typing.Optional[str]

        limit : typing.Optional[int]

        offset : typing.Optional[int]

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.list_transcriptions()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_transcriptions(
            status=status, limit=limit, offset=offset, request_options=request_options
        )
        return _response.data

    async def get_transcription(
        self,
        transcription_id: str,
        *,
        if_none_match: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Get transcription details by ID with conditional polling

        Parameters
        ----------
        transcription_id : str

        if_none_match : typing.Optional[str]

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.get_transcription(
                transcription_id="transcription_id",
            )


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

    async def delete_transcription(
        self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Dict[str, typing.Any]:
        """
        Delete transcription by ID (soft delete with upstream deletion)

        Parameters
        ----------
        transcription_id : str

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.delete_transcription(
                transcription_id="transcription_id",
            )


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

    async def search_transcript(
        self, transcription_id: str, *, query: str, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Search transcript for matching segments (stub endpoint for Phase 1)

        Parameters
        ----------
        transcription_id : str

        query : str
            Search query string

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.search_transcript(
                transcription_id="transcription_id",
                query="query",
            )


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

    async def get_redacted_audio(
        self, transcription_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Get audio with PII redacted (stub endpoint for Phase 1)

        Parameters
        ----------
        transcription_id : str

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.get_redacted_audio(
                transcription_id="transcription_id",
            )


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

    async def upload_audio_file(
        self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Upload audio file for transcription (stub endpoint for Phase 1)

        Parameters
        ----------
        file : core.File
            See core.File for more documentation

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.upload_audio_file()


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

    async def get_paragraphs(
        self,
        transcription_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Get transcript organized into paragraphs with timestamps

        Parameters
        ----------
        transcription_id : str

        limit : typing.Optional[int]
            Max paragraphs to return

        offset : typing.Optional[int]
            Number of paragraphs to skip

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.get_paragraphs(
                transcription_id="transcription_id",
            )


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

    async def get_sentences(
        self,
        transcription_id: str,
        *,
        limit: typing.Optional[int] = None,
        offset: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Get transcript organized into sentences with timestamps

        Parameters
        ----------
        transcription_id : str

        limit : typing.Optional[int]
            Max sentences to return

        offset : typing.Optional[int]
            Number of sentences to skip

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

        Returns
        -------
        typing.Dict[str, typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.get_sentences(
                transcription_id="transcription_id",
            )


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

    async def get_subtitles(
        self,
        transcription_id: str,
        format: str,
        *,
        chars_per_caption: typing.Optional[int] = None,
        max_lines: typing.Optional[int] = None,
        max_chars_per_line: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Get transcript in subtitle format (srt, vtt, txt)

        Parameters
        ----------
        transcription_id : str

        format : str

        chars_per_caption : typing.Optional[int]
            Max characters per caption (0 = no limit)

        max_lines : typing.Optional[int]
            Max lines per caption

        max_chars_per_line : typing.Optional[int]
            Max characters per line

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

        Returns
        -------
        typing.Any
            Subtitle content in requested format

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.audio.get_subtitles(
                transcription_id="transcription_id",
                format="format",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_subtitles(
            transcription_id,
            format,
            chars_per_caption=chars_per_caption,
            max_lines=max_lines,
            max_chars_per_line=max_chars_per_line,
            request_options=request_options,
        )
        return _response.data
