# 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 .raw_client import AsyncRawMeetingBuddyRecordingsClient, RawMeetingBuddyRecordingsClient


class MeetingBuddyRecordingsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyRecordingsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyRecordingsClient
        """
        return self._raw_client

    def download_meeting_buddy_recording(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Any:
        """
        Download the audio recording (WAV) for a completed Meeting Buddy session.

            **Requirements:**
            - Session must belong to the authenticated user's organization
            - Session must have a recording available
              (check `has_recording` on session response)

            **Response:**
            - Returns the WAV file as a binary download
            - Content-Type: audio/wav
            - Content-Disposition: attachment with filename

            **Authentication:** Requires valid JWT token or API key.
            User must have access to the session's organization.

            **Session ID Format:** Must start with `mbsess_` prefix.

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

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

        Returns
        -------
        typing.Any
            Recording file download

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_recordings.download_meeting_buddy_recording(
            session_id="session_id",
        )
        """
        _response = self._raw_client.download_meeting_buddy_recording(session_id, request_options=request_options)
        return _response.data

    def delete_meeting_buddy_session_permanent(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Permanently delete a Meeting Buddy session from the database.

            **Warning:** This action is irreversible. The session and all associated data
            (transcripts, metadata) will be permanently removed.

            **Authentication:** Requires valid JWT token. User must have access to the session's organization.

            **Session ID Format:** Must start with `mbsess_` prefix.

        Parameters
        ----------
        session_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.meeting_buddy_recordings.delete_meeting_buddy_session_permanent(
            session_id="session_id",
        )
        """
        _response = self._raw_client.delete_meeting_buddy_session_permanent(session_id, request_options=request_options)
        return _response.data


class AsyncMeetingBuddyRecordingsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyRecordingsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyRecordingsClient
        """
        return self._raw_client

    async def download_meeting_buddy_recording(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Any:
        """
        Download the audio recording (WAV) for a completed Meeting Buddy session.

            **Requirements:**
            - Session must belong to the authenticated user's organization
            - Session must have a recording available
              (check `has_recording` on session response)

            **Response:**
            - Returns the WAV file as a binary download
            - Content-Type: audio/wav
            - Content-Disposition: attachment with filename

            **Authentication:** Requires valid JWT token or API key.
            User must have access to the session's organization.

            **Session ID Format:** Must start with `mbsess_` prefix.

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

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

        Returns
        -------
        typing.Any
            Recording file download

        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_recordings.download_meeting_buddy_recording(
                session_id="session_id",
            )


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

    async def delete_meeting_buddy_session_permanent(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Permanently delete a Meeting Buddy session from the database.

            **Warning:** This action is irreversible. The session and all associated data
            (transcripts, metadata) will be permanently removed.

            **Authentication:** Requires valid JWT token. User must have access to the session's organization.

            **Session ID Format:** Must start with `mbsess_` prefix.

        Parameters
        ----------
        session_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.meeting_buddy_recordings.delete_meeting_buddy_session_permanent(
                session_id="session_id",
            )


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