# 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_voice_accents_response_model import GetVoiceAccentsResponseModel
from .raw_client import AsyncRawAccentsClient, RawAccentsClient


class AccentsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAccentsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawAccentsClient
        """
        return self._raw_client

    def get(
        self,
        *,
        language: typing.Optional[str] = None,
        model_id: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetVoiceAccentsResponseModel:
        """
        Gets the list of available accents in the shared voice library.

        Parameters
        ----------
        language : typing.Optional[str]
            If provided, only accents for this language code are returned.

        model_id : typing.Optional[str]
            If provided, returns the accents available for this model. Defaults to the most complete accent list when omitted.

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

        Returns
        -------
        GetVoiceAccentsResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.voices.accents.get(
            language="language",
            model_id="model_id",
        )
        """
        _response = self._raw_client.get(language=language, model_id=model_id, request_options=request_options)
        return _response.data


class AsyncAccentsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAccentsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawAccentsClient
        """
        return self._raw_client

    async def get(
        self,
        *,
        language: typing.Optional[str] = None,
        model_id: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetVoiceAccentsResponseModel:
        """
        Gets the list of available accents in the shared voice library.

        Parameters
        ----------
        language : typing.Optional[str]
            If provided, only accents for this language code are returned.

        model_id : typing.Optional[str]
            If provided, returns the accents available for this model. Defaults to the most complete accent list when omitted.

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

        Returns
        -------
        GetVoiceAccentsResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.voices.accents.get(
                language="language",
                model_id="model_id",
            )


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