# 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.assistant_active_session_response import AssistantActiveSessionResponse
from ..types.assistant_mbp_config_response import AssistantMbpConfigResponse
from ..types.regenerate_email_response import RegenerateEmailResponse
from ..types.session_response import SessionResponse
from .raw_client import AsyncRawAssistantMbpConfigurationClient, RawAssistantMbpConfigurationClient

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


class AssistantMbpConfigurationClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAssistantMbpConfigurationClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawAssistantMbpConfigurationClient
        """
        return self._raw_client

    def get_mbp_config(
        self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AssistantMbpConfigResponse:
        """
        Get an assistant's Meeting Buddy Protocol configuration.

        Parameters
        ----------
        assistant_id : str

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

        Returns
        -------
        AssistantMbpConfigResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.assistant_mbp_configuration.get_mbp_config(
            assistant_id="assistant_id",
        )
        """
        _response = self._raw_client.get_mbp_config(assistant_id, request_options=request_options)
        return _response.data

    def upsert_mbp_config(
        self,
        assistant_id: str,
        *,
        join_mode: typing.Optional[str] = OMIT,
        is_enabled: typing.Optional[bool] = OMIT,
        bot_name_override: typing.Optional[str] = OMIT,
        trigger_patterns: typing.Optional[typing.Sequence[str]] = OMIT,
        respond_to_direct_messages: typing.Optional[bool] = OMIT,
        respond_to_group_mentions: typing.Optional[bool] = OMIT,
        auto_join_rule_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_tool_categories: typing.Optional[typing.Sequence[str]] = OMIT,
        max_response_time_seconds: typing.Optional[int] = OMIT,
        meeting_summary_enabled: typing.Optional[bool] = OMIT,
        transcription_enabled: typing.Optional[bool] = OMIT,
        follow_user_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AssistantMbpConfigResponse:
        """
        Create or update an assistant's MBP configuration.

        Parameters
        ----------
        assistant_id : str

        join_mode : typing.Optional[str]
            Join mode: manual, calendar, or always

        is_enabled : typing.Optional[bool]
            Whether MBP is enabled

        bot_name_override : typing.Optional[str]
            Override bot display name (null = use assistant name)

        trigger_patterns : typing.Optional[typing.Sequence[str]]
            Chat trigger patterns, e.g. ['@{name}', 'Hey {name}']

        respond_to_direct_messages : typing.Optional[bool]
            Respond to direct messages in meeting chat

        respond_to_group_mentions : typing.Optional[bool]
            Respond when mentioned in group chat

        auto_join_rule_ids : typing.Optional[typing.Sequence[str]]
            Linked auto-join rule IDs

        allowed_tool_categories : typing.Optional[typing.Sequence[str]]
            Tool categories allowed during meetings

        max_response_time_seconds : typing.Optional[int]
            Max seconds before placeholder response

        meeting_summary_enabled : typing.Optional[bool]
            Auto-generate meeting summary

        transcription_enabled : typing.Optional[bool]
            Enable transcription during meetings

        follow_user_ids : typing.Optional[typing.Sequence[str]]
            User IDs whose meetings this assistant should auto-join

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

        Returns
        -------
        AssistantMbpConfigResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.assistant_mbp_configuration.upsert_mbp_config(
            assistant_id="assistant_id",
        )
        """
        _response = self._raw_client.upsert_mbp_config(
            assistant_id,
            join_mode=join_mode,
            is_enabled=is_enabled,
            bot_name_override=bot_name_override,
            trigger_patterns=trigger_patterns,
            respond_to_direct_messages=respond_to_direct_messages,
            respond_to_group_mentions=respond_to_group_mentions,
            auto_join_rule_ids=auto_join_rule_ids,
            allowed_tool_categories=allowed_tool_categories,
            max_response_time_seconds=max_response_time_seconds,
            meeting_summary_enabled=meeting_summary_enabled,
            transcription_enabled=transcription_enabled,
            follow_user_ids=follow_user_ids,
            request_options=request_options,
        )
        return _response.data

    def delete_mbp_config(self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Remove Meeting Buddy capability from an assistant.

        Parameters
        ----------
        assistant_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.assistant_mbp_configuration.delete_mbp_config(
            assistant_id="assistant_id",
        )
        """
        _response = self._raw_client.delete_mbp_config(assistant_id, request_options=request_options)
        return _response.data

    def assistant_join_meeting(
        self,
        assistant_id: str,
        *,
        meeting_link: str,
        transcription_language: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SessionResponse:
        """
        Create a Meeting Buddy session on behalf of an assistant. The bot joins the meeting using the assistant's name (or its configured override). Only one assistant can be in a meeting at a time within the same organization.

        Parameters
        ----------
        assistant_id : str

        meeting_link : str
            Meeting URL to join

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

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

        Returns
        -------
        SessionResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.assistant_mbp_configuration.assistant_join_meeting(
            assistant_id="assistant_id",
            meeting_link="meeting_link",
        )
        """
        _response = self._raw_client.assistant_join_meeting(
            assistant_id,
            meeting_link=meeting_link,
            transcription_language=transcription_language,
            request_options=request_options,
        )
        return _response.data

    def list_assistant_active_sessions(
        self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AssistantActiveSessionResponse:
        """
        Returns all active Meeting Buddy sessions that were initiated by the specified assistant.

        Parameters
        ----------
        assistant_id : str

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

        Returns
        -------
        AssistantActiveSessionResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.assistant_mbp_configuration.list_assistant_active_sessions(
            assistant_id="assistant_id",
        )
        """
        _response = self._raw_client.list_assistant_active_sessions(assistant_id, request_options=request_options)
        return _response.data

    def regenerate_meeting_email(
        self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RegenerateEmailResponse:
        """
        Force regenerate the meeting email address for an assistant.

        Parameters
        ----------
        assistant_id : str

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

        Returns
        -------
        RegenerateEmailResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.assistant_mbp_configuration.regenerate_meeting_email(
            assistant_id="assistant_id",
        )
        """
        _response = self._raw_client.regenerate_meeting_email(assistant_id, request_options=request_options)
        return _response.data


class AsyncAssistantMbpConfigurationClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAssistantMbpConfigurationClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawAssistantMbpConfigurationClient
        """
        return self._raw_client

    async def get_mbp_config(
        self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AssistantMbpConfigResponse:
        """
        Get an assistant's Meeting Buddy Protocol configuration.

        Parameters
        ----------
        assistant_id : str

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

        Returns
        -------
        AssistantMbpConfigResponse
            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.assistant_mbp_configuration.get_mbp_config(
                assistant_id="assistant_id",
            )


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

    async def upsert_mbp_config(
        self,
        assistant_id: str,
        *,
        join_mode: typing.Optional[str] = OMIT,
        is_enabled: typing.Optional[bool] = OMIT,
        bot_name_override: typing.Optional[str] = OMIT,
        trigger_patterns: typing.Optional[typing.Sequence[str]] = OMIT,
        respond_to_direct_messages: typing.Optional[bool] = OMIT,
        respond_to_group_mentions: typing.Optional[bool] = OMIT,
        auto_join_rule_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        allowed_tool_categories: typing.Optional[typing.Sequence[str]] = OMIT,
        max_response_time_seconds: typing.Optional[int] = OMIT,
        meeting_summary_enabled: typing.Optional[bool] = OMIT,
        transcription_enabled: typing.Optional[bool] = OMIT,
        follow_user_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AssistantMbpConfigResponse:
        """
        Create or update an assistant's MBP configuration.

        Parameters
        ----------
        assistant_id : str

        join_mode : typing.Optional[str]
            Join mode: manual, calendar, or always

        is_enabled : typing.Optional[bool]
            Whether MBP is enabled

        bot_name_override : typing.Optional[str]
            Override bot display name (null = use assistant name)

        trigger_patterns : typing.Optional[typing.Sequence[str]]
            Chat trigger patterns, e.g. ['@{name}', 'Hey {name}']

        respond_to_direct_messages : typing.Optional[bool]
            Respond to direct messages in meeting chat

        respond_to_group_mentions : typing.Optional[bool]
            Respond when mentioned in group chat

        auto_join_rule_ids : typing.Optional[typing.Sequence[str]]
            Linked auto-join rule IDs

        allowed_tool_categories : typing.Optional[typing.Sequence[str]]
            Tool categories allowed during meetings

        max_response_time_seconds : typing.Optional[int]
            Max seconds before placeholder response

        meeting_summary_enabled : typing.Optional[bool]
            Auto-generate meeting summary

        transcription_enabled : typing.Optional[bool]
            Enable transcription during meetings

        follow_user_ids : typing.Optional[typing.Sequence[str]]
            User IDs whose meetings this assistant should auto-join

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

        Returns
        -------
        AssistantMbpConfigResponse
            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.assistant_mbp_configuration.upsert_mbp_config(
                assistant_id="assistant_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.upsert_mbp_config(
            assistant_id,
            join_mode=join_mode,
            is_enabled=is_enabled,
            bot_name_override=bot_name_override,
            trigger_patterns=trigger_patterns,
            respond_to_direct_messages=respond_to_direct_messages,
            respond_to_group_mentions=respond_to_group_mentions,
            auto_join_rule_ids=auto_join_rule_ids,
            allowed_tool_categories=allowed_tool_categories,
            max_response_time_seconds=max_response_time_seconds,
            meeting_summary_enabled=meeting_summary_enabled,
            transcription_enabled=transcription_enabled,
            follow_user_ids=follow_user_ids,
            request_options=request_options,
        )
        return _response.data

    async def delete_mbp_config(
        self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Remove Meeting Buddy capability from an assistant.

        Parameters
        ----------
        assistant_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.assistant_mbp_configuration.delete_mbp_config(
                assistant_id="assistant_id",
            )


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

    async def assistant_join_meeting(
        self,
        assistant_id: str,
        *,
        meeting_link: str,
        transcription_language: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SessionResponse:
        """
        Create a Meeting Buddy session on behalf of an assistant. The bot joins the meeting using the assistant's name (or its configured override). Only one assistant can be in a meeting at a time within the same organization.

        Parameters
        ----------
        assistant_id : str

        meeting_link : str
            Meeting URL to join

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

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

        Returns
        -------
        SessionResponse
            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.assistant_mbp_configuration.assistant_join_meeting(
                assistant_id="assistant_id",
                meeting_link="meeting_link",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.assistant_join_meeting(
            assistant_id,
            meeting_link=meeting_link,
            transcription_language=transcription_language,
            request_options=request_options,
        )
        return _response.data

    async def list_assistant_active_sessions(
        self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AssistantActiveSessionResponse:
        """
        Returns all active Meeting Buddy sessions that were initiated by the specified assistant.

        Parameters
        ----------
        assistant_id : str

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

        Returns
        -------
        AssistantActiveSessionResponse
            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.assistant_mbp_configuration.list_assistant_active_sessions(
                assistant_id="assistant_id",
            )


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

    async def regenerate_meeting_email(
        self, assistant_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RegenerateEmailResponse:
        """
        Force regenerate the meeting email address for an assistant.

        Parameters
        ----------
        assistant_id : str

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

        Returns
        -------
        RegenerateEmailResponse
            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.assistant_mbp_configuration.regenerate_meeting_email(
                assistant_id="assistant_id",
            )


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