# 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 AsyncRawMeetingBuddyUploadsClient, RawMeetingBuddyUploadsClient

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


class MeetingBuddyUploadsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyUploadsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyUploadsClient
        """
        return self._raw_client

    def upload_recording_for_transcription(
        self,
        *,
        file: core.File,
        title: typing.Optional[str] = OMIT,
        meeting_date: typing.Optional[str] = OMIT,
        participants: typing.Optional[str] = OMIT,
        language: typing.Optional[str] = OMIT,
        bot_name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Upload an audio or video file for offline transcription without a bot.

        Accepted audio formats: WAV, MP3, M4A, FLAC, OGG. Max size: 500 MB.
        Accepted video formats: MP4, WEBM, MOV, MKV. Max size: 2 GB.
        Creates a session with source='upload' and triggers background transcription.

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

        title : typing.Optional[str]
            Meeting title (defaults to filename)

        meeting_date : typing.Optional[str]
            When the meeting took place (ISO datetime string)

        participants : typing.Optional[str]
            Comma-separated list of participant names

        language : typing.Optional[str]
            Language code for transcription

        bot_name : typing.Optional[str]
            Display name for the upload session

        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.meeting_buddy_uploads.upload_recording_for_transcription()
        """
        _response = self._raw_client.upload_recording_for_transcription(
            file=file,
            title=title,
            meeting_date=meeting_date,
            participants=participants,
            language=language,
            bot_name=bot_name,
            request_options=request_options,
        )
        return _response.data

    def get_upload_status(
        self, upload_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Dict[str, typing.Any]:
        """
        Check the processing status of an uploaded audio file.

        Parameters
        ----------
        upload_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.meeting_buddy_uploads.get_upload_status(
            upload_id="upload_id",
        )
        """
        _response = self._raw_client.get_upload_status(upload_id, request_options=request_options)
        return _response.data

    def set_session_language(
        self, session_id: str, *, language: str, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Dict[str, typing.Any]:
        """
        Set or change the transcription language for a session.

        Parameters
        ----------
        session_id : str

        language : str
            Language code for transcription (e.g., 'en', 'es', 'de')

        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.meeting_buddy_uploads.set_session_language(
            session_id="session_id",
            language="language",
        )
        """
        _response = self._raw_client.set_session_language(
            session_id, language=language, request_options=request_options
        )
        return _response.data


class AsyncMeetingBuddyUploadsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyUploadsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyUploadsClient
        """
        return self._raw_client

    async def upload_recording_for_transcription(
        self,
        *,
        file: core.File,
        title: typing.Optional[str] = OMIT,
        meeting_date: typing.Optional[str] = OMIT,
        participants: typing.Optional[str] = OMIT,
        language: typing.Optional[str] = OMIT,
        bot_name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Upload an audio or video file for offline transcription without a bot.

        Accepted audio formats: WAV, MP3, M4A, FLAC, OGG. Max size: 500 MB.
        Accepted video formats: MP4, WEBM, MOV, MKV. Max size: 2 GB.
        Creates a session with source='upload' and triggers background transcription.

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

        title : typing.Optional[str]
            Meeting title (defaults to filename)

        meeting_date : typing.Optional[str]
            When the meeting took place (ISO datetime string)

        participants : typing.Optional[str]
            Comma-separated list of participant names

        language : typing.Optional[str]
            Language code for transcription

        bot_name : typing.Optional[str]
            Display name for the upload session

        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.meeting_buddy_uploads.upload_recording_for_transcription()


        asyncio.run(main())
        """
        _response = await self._raw_client.upload_recording_for_transcription(
            file=file,
            title=title,
            meeting_date=meeting_date,
            participants=participants,
            language=language,
            bot_name=bot_name,
            request_options=request_options,
        )
        return _response.data

    async def get_upload_status(
        self, upload_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Dict[str, typing.Any]:
        """
        Check the processing status of an uploaded audio file.

        Parameters
        ----------
        upload_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.meeting_buddy_uploads.get_upload_status(
                upload_id="upload_id",
            )


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

    async def set_session_language(
        self, session_id: str, *, language: str, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Dict[str, typing.Any]:
        """
        Set or change the transcription language for a session.

        Parameters
        ----------
        session_id : str

        language : str
            Language code for transcription (e.g., 'en', 'es', 'de')

        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.meeting_buddy_uploads.set_session_language(
                session_id="session_id",
                language="language",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.set_session_language(
            session_id, language=language, request_options=request_options
        )
        return _response.data
