# 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.briefing_response import BriefingResponse
from ..types.coaching_score_response import CoachingScoreResponse
from ..types.competitor_list_response import CompetitorListResponse
from ..types.competitor_mention_list_response import CompetitorMentionListResponse
from ..types.deal_list_response import DealListResponse
from ..types.deal_timeline_response import DealTimelineResponse
from ..types.deal_tracking_response import DealTrackingResponse
from ..types.framework_list_response import FrameworkListResponse
from ..types.revenue_intelligence_response import RevenueIntelligenceResponse
from ..types.team_summary_response import TeamSummaryResponse
from .raw_client import AsyncRawMeetingBuddyRevenueIntelligenceClient, RawMeetingBuddyRevenueIntelligenceClient

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


class MeetingBuddyRevenueIntelligenceClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMeetingBuddyRevenueIntelligenceClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawMeetingBuddyRevenueIntelligenceClient
        """
        return self._raw_client

    def get_revenue_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RevenueIntelligenceResponse:
        """
        Get revenue-specific intelligence for a sales meeting session.

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

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

        Returns
        -------
        RevenueIntelligenceResponse
            Successful Response

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

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

    def list_deals(
        self,
        *,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DealListResponse:
        """
        List all tracked deals with health scores for the organization.

        Parameters
        ----------
        page : typing.Optional[int]

        page_size : typing.Optional[int]

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

        Returns
        -------
        DealListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.list_deals()
        """
        _response = self._raw_client.list_deals(page=page, page_size=page_size, request_options=request_options)
        return _response.data

    def get_deal_timeline(
        self, deal_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DealTimelineResponse:
        """
        Get multi-meeting timeline for a specific deal.

        Parameters
        ----------
        deal_id : str

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

        Returns
        -------
        DealTimelineResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.get_deal_timeline(
            deal_id="deal_id",
        )
        """
        _response = self._raw_client.get_deal_timeline(deal_id, request_options=request_options)
        return _response.data

    def link_session_to_deal(
        self,
        session_id: str,
        *,
        deal_id: str,
        deal_name: typing.Optional[str] = OMIT,
        crm_provider: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DealTrackingResponse:
        """
        Link a meeting session to a CRM deal/opportunity.

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

        deal_id : str
            External CRM deal/opportunity ID

        deal_name : typing.Optional[str]
            Human-readable deal name

        crm_provider : typing.Optional[str]
            CRM provider: hubspot, salesforce, pipedrive

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

        Returns
        -------
        DealTrackingResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.link_session_to_deal(
            session_id="session_id",
            deal_id="deal_id",
        )
        """
        _response = self._raw_client.link_session_to_deal(
            session_id, deal_id=deal_id, deal_name=deal_name, crm_provider=crm_provider, request_options=request_options
        )
        return _response.data

    def list_competitor_mentions(
        self,
        *,
        competitor_name: typing.Optional[str] = None,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CompetitorMentionListResponse:
        """
        Get filterable competitor mention report for the organization.

        Parameters
        ----------
        competitor_name : typing.Optional[str]
            Filter by competitor name

        page : typing.Optional[int]

        page_size : typing.Optional[int]

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

        Returns
        -------
        CompetitorMentionListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.list_competitor_mentions()
        """
        _response = self._raw_client.list_competitor_mentions(
            competitor_name=competitor_name, page=page, page_size=page_size, request_options=request_options
        )
        return _response.data

    def set_competitors(
        self, *, competitors: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> CompetitorListResponse:
        """
        Set the organization's competitor keyword list for detection.

        Parameters
        ----------
        competitors : typing.Sequence[str]
            List of competitor names/keywords

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

        Returns
        -------
        CompetitorListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.set_competitors(
            competitors=["competitors"],
        )
        """
        _response = self._raw_client.set_competitors(competitors=competitors, request_options=request_options)
        return _response.data

    def get_coaching_scorecard(
        self,
        session_id: str,
        *,
        framework: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[CoachingScoreResponse]:
        """
        Get coaching scorecard(s) for a meeting session.

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

        framework : typing.Optional[str]
            Filter by framework

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

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

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.get_coaching_scorecard(
            session_id="session_id",
        )
        """
        _response = self._raw_client.get_coaching_scorecard(
            session_id, framework=framework, request_options=request_options
        )
        return _response.data

    def get_team_coaching_summary(
        self, *, framework: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> TeamSummaryResponse:
        """
        Get aggregated coaching scores across the team (manager view).

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

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

        Returns
        -------
        TeamSummaryResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.get_team_coaching_summary()
        """
        _response = self._raw_client.get_team_coaching_summary(framework=framework, request_options=request_options)
        return _response.data

    def set_coaching_frameworks(
        self, *, frameworks: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> FrameworkListResponse:
        """
        Set which coaching frameworks are available for the organization.

        Parameters
        ----------
        frameworks : typing.Sequence[str]
            List of framework names: meddic, bant, spin, or custom names

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

        Returns
        -------
        FrameworkListResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.set_coaching_frameworks(
            frameworks=["frameworks"],
        )
        """
        _response = self._raw_client.set_coaching_frameworks(frameworks=frameworks, request_options=request_options)
        return _response.data

    def get_briefing(
        self, event_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BriefingResponse:
        """
        Generate a pre-meeting briefing for an upcoming calendar event.

        Parameters
        ----------
        event_id : str

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

        Returns
        -------
        BriefingResponse
            Successful Response

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

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.meeting_buddy_revenue_intelligence.get_briefing(
            event_id="event_id",
        )
        """
        _response = self._raw_client.get_briefing(event_id, request_options=request_options)
        return _response.data


class AsyncMeetingBuddyRevenueIntelligenceClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMeetingBuddyRevenueIntelligenceClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawMeetingBuddyRevenueIntelligenceClient
        """
        return self._raw_client

    async def get_revenue_intelligence(
        self, session_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RevenueIntelligenceResponse:
        """
        Get revenue-specific intelligence for a sales meeting session.

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

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

        Returns
        -------
        RevenueIntelligenceResponse
            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_revenue_intelligence.get_revenue_intelligence(
                session_id="session_id",
            )


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

    async def list_deals(
        self,
        *,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DealListResponse:
        """
        List all tracked deals with health scores for the organization.

        Parameters
        ----------
        page : typing.Optional[int]

        page_size : typing.Optional[int]

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

        Returns
        -------
        DealListResponse
            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_revenue_intelligence.list_deals()


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

    async def get_deal_timeline(
        self, deal_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DealTimelineResponse:
        """
        Get multi-meeting timeline for a specific deal.

        Parameters
        ----------
        deal_id : str

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

        Returns
        -------
        DealTimelineResponse
            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_revenue_intelligence.get_deal_timeline(
                deal_id="deal_id",
            )


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

    async def link_session_to_deal(
        self,
        session_id: str,
        *,
        deal_id: str,
        deal_name: typing.Optional[str] = OMIT,
        crm_provider: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DealTrackingResponse:
        """
        Link a meeting session to a CRM deal/opportunity.

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

        deal_id : str
            External CRM deal/opportunity ID

        deal_name : typing.Optional[str]
            Human-readable deal name

        crm_provider : typing.Optional[str]
            CRM provider: hubspot, salesforce, pipedrive

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

        Returns
        -------
        DealTrackingResponse
            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_revenue_intelligence.link_session_to_deal(
                session_id="session_id",
                deal_id="deal_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.link_session_to_deal(
            session_id, deal_id=deal_id, deal_name=deal_name, crm_provider=crm_provider, request_options=request_options
        )
        return _response.data

    async def list_competitor_mentions(
        self,
        *,
        competitor_name: typing.Optional[str] = None,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CompetitorMentionListResponse:
        """
        Get filterable competitor mention report for the organization.

        Parameters
        ----------
        competitor_name : typing.Optional[str]
            Filter by competitor name

        page : typing.Optional[int]

        page_size : typing.Optional[int]

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

        Returns
        -------
        CompetitorMentionListResponse
            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_revenue_intelligence.list_competitor_mentions()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_competitor_mentions(
            competitor_name=competitor_name, page=page, page_size=page_size, request_options=request_options
        )
        return _response.data

    async def set_competitors(
        self, *, competitors: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> CompetitorListResponse:
        """
        Set the organization's competitor keyword list for detection.

        Parameters
        ----------
        competitors : typing.Sequence[str]
            List of competitor names/keywords

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

        Returns
        -------
        CompetitorListResponse
            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_revenue_intelligence.set_competitors(
                competitors=["competitors"],
            )


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

    async def get_coaching_scorecard(
        self,
        session_id: str,
        *,
        framework: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[CoachingScoreResponse]:
        """
        Get coaching scorecard(s) for a meeting session.

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

        framework : typing.Optional[str]
            Filter by framework

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

        Returns
        -------
        typing.List[CoachingScoreResponse]
            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_revenue_intelligence.get_coaching_scorecard(
                session_id="session_id",
            )


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

    async def get_team_coaching_summary(
        self, *, framework: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> TeamSummaryResponse:
        """
        Get aggregated coaching scores across the team (manager view).

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

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

        Returns
        -------
        TeamSummaryResponse
            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_revenue_intelligence.get_team_coaching_summary()


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

    async def set_coaching_frameworks(
        self, *, frameworks: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> FrameworkListResponse:
        """
        Set which coaching frameworks are available for the organization.

        Parameters
        ----------
        frameworks : typing.Sequence[str]
            List of framework names: meddic, bant, spin, or custom names

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

        Returns
        -------
        FrameworkListResponse
            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_revenue_intelligence.set_coaching_frameworks(
                frameworks=["frameworks"],
            )


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

    async def get_briefing(
        self, event_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> BriefingResponse:
        """
        Generate a pre-meeting briefing for an upcoming calendar event.

        Parameters
        ----------
        event_id : str

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

        Returns
        -------
        BriefingResponse
            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_revenue_intelligence.get_briefing(
                event_id="event_id",
            )


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