# 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.get_live_count_response import GetLiveCountResponse
from .raw_client import AsyncRawLiveCountClient, RawLiveCountClient


class LiveCountClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawLiveCountClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawLiveCountClient
        """
        return self._raw_client

    def get(
        self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> GetLiveCountResponse:
        """
        Get the live count of the ongoing conversations.

        Parameters
        ----------
        agent_id : typing.Optional[str]
            The id of an agent to restrict the analytics to.

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

        Returns
        -------
        GetLiveCountResponse
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.analytics.live_count.get(
            agent_id="agent_id",
        )
        """
        _response = self._raw_client.get(agent_id=agent_id, request_options=request_options)
        return _response.data


class AsyncLiveCountClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawLiveCountClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawLiveCountClient
        """
        return self._raw_client

    async def get(
        self, *, agent_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> GetLiveCountResponse:
        """
        Get the live count of the ongoing conversations.

        Parameters
        ----------
        agent_id : typing.Optional[str]
            The id of an agent to restrict the analytics to.

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

        Returns
        -------
        GetLiveCountResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.analytics.live_count.get(
                agent_id="agent_id",
            )


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