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

import datetime as dt
import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.action_item_list_response import ActionItemListResponse
from ..types.action_item_response import ActionItemResponse
from ..types.decision_list_response import DecisionListResponse
from ..types.intelligence_response import IntelligenceResponse
from .raw_client import AsyncRawMeetingBuddyIntelligenceClient, RawMeetingBuddyIntelligenceClient

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


class MeetingBuddyIntelligenceClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyIntelligenceClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyIntelligenceClient
        """
        return self._raw_client

    def share_meeting_summary(
        self,
        session_id: str,
        *,
        recipients: typing.Sequence[str],
        include_action_items: typing.Optional[bool] = OMIT,
        include_decisions: typing.Optional[bool] = OMIT,
        message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Share a meeting summary via email (stub endpoint).

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

        recipients : typing.Sequence[str]
            List of email addresses to share the summary with

        include_action_items : typing.Optional[bool]
            Include action items in the shared summary

        include_decisions : typing.Optional[bool]
            Include key decisions in the shared summary

        message : typing.Optional[str]
            Optional personal message to include

        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_intelligence.share_meeting_summary(
            session_id="session_id",
            recipients=["recipients"],
        )
        """
        _response = self._raw_client.share_meeting_summary(
            session_id,
            recipients=recipients,
            include_action_items=include_action_items,
            include_decisions=include_decisions,
            message=message,
            request_options=request_options,
        )
        return _response.data

    def get_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IntelligenceResponse:
        """
        Get AI-generated intelligence for a completed meeting session.

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

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

        Returns
        -------
        IntelligenceResponse
            Successful Response

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

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

    def regenerate_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IntelligenceResponse:
        """
        Re-run AI extraction for a meeting session. Returns immediately with status=processing. Poll GET /intelligence to track progress.

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

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

        Returns
        -------
        IntelligenceResponse
            Successful Response

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

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

    def generate_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IntelligenceResponse:
        """
        Generate AI intelligence for a session. Returns immediately with status=processing. Poll GET /intelligence to track progress.

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

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

        Returns
        -------
        IntelligenceResponse
            Successful Response

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

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

    def list_session_action_items(
        self,
        session_id: str,
        *,
        status: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ActionItemResponse]:
        """
        Get all action items extracted from a meeting session.

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

        status : typing.Optional[str]
            Filter by status

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

        Returns
        -------
        typing.List[ActionItemResponse]
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_intelligence.list_session_action_items(
            session_id="session_id",
        )
        """
        _response = self._raw_client.list_session_action_items(
            session_id, status=status, request_options=request_options
        )
        return _response.data

    def update_action_item(
        self,
        session_id: str,
        item_id: str,
        *,
        title: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        assigned_to: typing.Optional[str] = OMIT,
        due_date: typing.Optional[dt.date] = OMIT,
        priority: typing.Optional[str] = OMIT,
        status: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ActionItemResponse:
        """
        Update action item fields (title, description, assignee, priority, status, due date).

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

        item_id : str

        title : typing.Optional[str]

        description : typing.Optional[str]

        assigned_to : typing.Optional[str]

        due_date : typing.Optional[dt.date]

        priority : typing.Optional[str]

        status : typing.Optional[str]

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

        Returns
        -------
        ActionItemResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_intelligence.update_action_item(
            session_id="session_id",
            item_id="item_id",
        )
        """
        _response = self._raw_client.update_action_item(
            session_id,
            item_id,
            title=title,
            description=description,
            assigned_to=assigned_to,
            due_date=due_date,
            priority=priority,
            status=status,
            request_options=request_options,
        )
        return _response.data

    def route_action_item(
        self,
        session_id: str,
        item_id: str,
        *,
        target_tool: str,
        extra_params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Route an action item to an external project management tool (ClickUp, Jira, Asana, GitHub).

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

        item_id : str

        target_tool : str
            Target tool name (clickup, jira, asana, github)

        extra_params : typing.Optional[typing.Dict[str, typing.Any]]
            Additional tool-specific parameters (e.g., list_id for ClickUp, project for Jira)

        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_intelligence.route_action_item(
            session_id="session_id",
            item_id="item_id",
            target_tool="target_tool",
        )
        """
        _response = self._raw_client.route_action_item(
            session_id, item_id, target_tool=target_tool, extra_params=extra_params, request_options=request_options
        )
        return _response.data

    def list_all_action_items(
        self,
        *,
        status: typing.Optional[str] = None,
        assigned_to: typing.Optional[str] = None,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ActionItemListResponse:
        """
        List all action items across all meeting sessions with filtering and pagination.

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

        assigned_to : typing.Optional[str]
            Filter by assigned user ID

        page : typing.Optional[int]
            Page number

        page_size : typing.Optional[int]
            Items per page

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

        Returns
        -------
        ActionItemListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_intelligence.list_all_action_items()
        """
        _response = self._raw_client.list_all_action_items(
            status=status, assigned_to=assigned_to, page=page, page_size=page_size, request_options=request_options
        )
        return _response.data

    def list_decisions(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DecisionListResponse:
        """
        Get key decisions extracted from a meeting session.

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

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

        Returns
        -------
        DecisionListResponse
            Successful Response

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

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


class AsyncMeetingBuddyIntelligenceClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyIntelligenceClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyIntelligenceClient
        """
        return self._raw_client

    async def share_meeting_summary(
        self,
        session_id: str,
        *,
        recipients: typing.Sequence[str],
        include_action_items: typing.Optional[bool] = OMIT,
        include_decisions: typing.Optional[bool] = OMIT,
        message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Share a meeting summary via email (stub endpoint).

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

        recipients : typing.Sequence[str]
            List of email addresses to share the summary with

        include_action_items : typing.Optional[bool]
            Include action items in the shared summary

        include_decisions : typing.Optional[bool]
            Include key decisions in the shared summary

        message : typing.Optional[str]
            Optional personal message to include

        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_intelligence.share_meeting_summary(
                session_id="session_id",
                recipients=["recipients"],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.share_meeting_summary(
            session_id,
            recipients=recipients,
            include_action_items=include_action_items,
            include_decisions=include_decisions,
            message=message,
            request_options=request_options,
        )
        return _response.data

    async def get_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IntelligenceResponse:
        """
        Get AI-generated intelligence for a completed meeting session.

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

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

        Returns
        -------
        IntelligenceResponse
            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_intelligence.get_intelligence(
                session_id="session_id",
            )


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

    async def regenerate_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IntelligenceResponse:
        """
        Re-run AI extraction for a meeting session. Returns immediately with status=processing. Poll GET /intelligence to track progress.

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

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

        Returns
        -------
        IntelligenceResponse
            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_intelligence.regenerate_intelligence(
                session_id="session_id",
            )


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

    async def generate_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IntelligenceResponse:
        """
        Generate AI intelligence for a session. Returns immediately with status=processing. Poll GET /intelligence to track progress.

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

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

        Returns
        -------
        IntelligenceResponse
            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_intelligence.generate_intelligence(
                session_id="session_id",
            )


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

    async def list_session_action_items(
        self,
        session_id: str,
        *,
        status: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ActionItemResponse]:
        """
        Get all action items extracted from a meeting session.

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

        status : typing.Optional[str]
            Filter by status

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

        Returns
        -------
        typing.List[ActionItemResponse]
            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_intelligence.list_session_action_items(
                session_id="session_id",
            )


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

    async def update_action_item(
        self,
        session_id: str,
        item_id: str,
        *,
        title: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        assigned_to: typing.Optional[str] = OMIT,
        due_date: typing.Optional[dt.date] = OMIT,
        priority: typing.Optional[str] = OMIT,
        status: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ActionItemResponse:
        """
        Update action item fields (title, description, assignee, priority, status, due date).

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

        item_id : str

        title : typing.Optional[str]

        description : typing.Optional[str]

        assigned_to : typing.Optional[str]

        due_date : typing.Optional[dt.date]

        priority : typing.Optional[str]

        status : typing.Optional[str]

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

        Returns
        -------
        ActionItemResponse
            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_intelligence.update_action_item(
                session_id="session_id",
                item_id="item_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_action_item(
            session_id,
            item_id,
            title=title,
            description=description,
            assigned_to=assigned_to,
            due_date=due_date,
            priority=priority,
            status=status,
            request_options=request_options,
        )
        return _response.data

    async def route_action_item(
        self,
        session_id: str,
        item_id: str,
        *,
        target_tool: str,
        extra_params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Dict[str, typing.Any]:
        """
        Route an action item to an external project management tool (ClickUp, Jira, Asana, GitHub).

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

        item_id : str

        target_tool : str
            Target tool name (clickup, jira, asana, github)

        extra_params : typing.Optional[typing.Dict[str, typing.Any]]
            Additional tool-specific parameters (e.g., list_id for ClickUp, project for Jira)

        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_intelligence.route_action_item(
                session_id="session_id",
                item_id="item_id",
                target_tool="target_tool",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.route_action_item(
            session_id, item_id, target_tool=target_tool, extra_params=extra_params, request_options=request_options
        )
        return _response.data

    async def list_all_action_items(
        self,
        *,
        status: typing.Optional[str] = None,
        assigned_to: typing.Optional[str] = None,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ActionItemListResponse:
        """
        List all action items across all meeting sessions with filtering and pagination.

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

        assigned_to : typing.Optional[str]
            Filter by assigned user ID

        page : typing.Optional[int]
            Page number

        page_size : typing.Optional[int]
            Items per page

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

        Returns
        -------
        ActionItemListResponse
            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_intelligence.list_all_action_items()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_all_action_items(
            status=status, assigned_to=assigned_to, page=page, page_size=page_size, request_options=request_options
        )
        return _response.data

    async def list_decisions(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DecisionListResponse:
        """
        Get key decisions extracted from a meeting session.

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

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

        Returns
        -------
        DecisionListResponse
            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_intelligence.list_decisions(
                session_id="session_id",
            )


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