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

import typing
from json.decoder import JSONDecodeError

from ..core.api_error import ApiError
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.unprocessable_entity_error import UnprocessableEntityError
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

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


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

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

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

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

        Returns
        -------
        HttpResponse[RevenueIntelligenceResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/sessions/{jsonable_encoder(session_id)}/revenue-intelligence",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    RevenueIntelligenceResponse,
                    parse_obj_as(
                        type_=RevenueIntelligenceResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def list_deals(
        self,
        *,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[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
        -------
        HttpResponse[DealListResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/deals",
            method="GET",
            params={
                "page": page,
                "page_size": page_size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    DealListResponse,
                    parse_obj_as(
                        type_=DealListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

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

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

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

        Returns
        -------
        HttpResponse[DealTimelineResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/deals/{jsonable_encoder(deal_id)}/timeline",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    DealTimelineResponse,
                    parse_obj_as(
                        type_=DealTimelineResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    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,
    ) -> HttpResponse[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
        -------
        HttpResponse[DealTrackingResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/sessions/{jsonable_encoder(session_id)}/deal-link",
            method="POST",
            json={
                "deal_id": deal_id,
                "deal_name": deal_name,
                "crm_provider": crm_provider,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    DealTrackingResponse,
                    parse_obj_as(
                        type_=DealTrackingResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    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,
    ) -> HttpResponse[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
        -------
        HttpResponse[CompetitorMentionListResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/competitor-mentions",
            method="GET",
            params={
                "competitor_name": competitor_name,
                "page": page,
                "page_size": page_size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    CompetitorMentionListResponse,
                    parse_obj_as(
                        type_=CompetitorMentionListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def set_competitors(
        self, *, competitors: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[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
        -------
        HttpResponse[CompetitorListResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/competitors",
            method="PUT",
            json={
                "competitors": competitors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    CompetitorListResponse,
                    parse_obj_as(
                        type_=CompetitorListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def get_coaching_scorecard(
        self,
        session_id: str,
        *,
        framework: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[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
        -------
        HttpResponse[typing.List[CoachingScoreResponse]]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/sessions/{jsonable_encoder(session_id)}/coaching-scorecard",
            method="GET",
            params={
                "framework": framework,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    typing.List[CoachingScoreResponse],
                    parse_obj_as(
                        type_=typing.List[CoachingScoreResponse],  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def get_team_coaching_summary(
        self, *, framework: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[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
        -------
        HttpResponse[TeamSummaryResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/coaching/team-summary",
            method="GET",
            params={
                "framework": framework,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    TeamSummaryResponse,
                    parse_obj_as(
                        type_=TeamSummaryResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def set_coaching_frameworks(
        self, *, frameworks: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[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
        -------
        HttpResponse[FrameworkListResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/coaching/frameworks",
            method="PUT",
            json={
                "frameworks": frameworks,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    FrameworkListResponse,
                    parse_obj_as(
                        type_=FrameworkListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

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

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

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

        Returns
        -------
        HttpResponse[BriefingResponse]
            Successful Response
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/briefing/{jsonable_encoder(event_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    BriefingResponse,
                    parse_obj_as(
                        type_=BriefingResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)


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

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

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

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

        Returns
        -------
        AsyncHttpResponse[RevenueIntelligenceResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/sessions/{jsonable_encoder(session_id)}/revenue-intelligence",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    RevenueIntelligenceResponse,
                    parse_obj_as(
                        type_=RevenueIntelligenceResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def list_deals(
        self,
        *,
        page: typing.Optional[int] = None,
        page_size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[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
        -------
        AsyncHttpResponse[DealListResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/deals",
            method="GET",
            params={
                "page": page,
                "page_size": page_size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    DealListResponse,
                    parse_obj_as(
                        type_=DealListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

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

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

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

        Returns
        -------
        AsyncHttpResponse[DealTimelineResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/deals/{jsonable_encoder(deal_id)}/timeline",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    DealTimelineResponse,
                    parse_obj_as(
                        type_=DealTimelineResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    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,
    ) -> AsyncHttpResponse[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
        -------
        AsyncHttpResponse[DealTrackingResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/sessions/{jsonable_encoder(session_id)}/deal-link",
            method="POST",
            json={
                "deal_id": deal_id,
                "deal_name": deal_name,
                "crm_provider": crm_provider,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    DealTrackingResponse,
                    parse_obj_as(
                        type_=DealTrackingResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    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,
    ) -> AsyncHttpResponse[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
        -------
        AsyncHttpResponse[CompetitorMentionListResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/competitor-mentions",
            method="GET",
            params={
                "competitor_name": competitor_name,
                "page": page,
                "page_size": page_size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    CompetitorMentionListResponse,
                    parse_obj_as(
                        type_=CompetitorMentionListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def set_competitors(
        self, *, competitors: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[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
        -------
        AsyncHttpResponse[CompetitorListResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/competitors",
            method="PUT",
            json={
                "competitors": competitors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    CompetitorListResponse,
                    parse_obj_as(
                        type_=CompetitorListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def get_coaching_scorecard(
        self,
        session_id: str,
        *,
        framework: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[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
        -------
        AsyncHttpResponse[typing.List[CoachingScoreResponse]]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/sessions/{jsonable_encoder(session_id)}/coaching-scorecard",
            method="GET",
            params={
                "framework": framework,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    typing.List[CoachingScoreResponse],
                    parse_obj_as(
                        type_=typing.List[CoachingScoreResponse],  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def get_team_coaching_summary(
        self, *, framework: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[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
        -------
        AsyncHttpResponse[TeamSummaryResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/coaching/team-summary",
            method="GET",
            params={
                "framework": framework,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    TeamSummaryResponse,
                    parse_obj_as(
                        type_=TeamSummaryResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def set_coaching_frameworks(
        self, *, frameworks: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[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
        -------
        AsyncHttpResponse[FrameworkListResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/meeting-buddy/coaching/frameworks",
            method="PUT",
            json={
                "frameworks": frameworks,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    FrameworkListResponse,
                    parse_obj_as(
                        type_=FrameworkListResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

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

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

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

        Returns
        -------
        AsyncHttpResponse[BriefingResponse]
            Successful Response
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v1/meeting-buddy/briefing/{jsonable_encoder(event_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    BriefingResponse,
                    parse_obj_as(
                        type_=BriefingResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    headers=dict(_response.headers),
                    body=typing.cast(
                        typing.Any,
                        parse_obj_as(
                            type_=typing.Any,  # type: ignore
                            object_=_response.json(),
                        ),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
