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

import typing

from ... import core
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.request_options import RequestOptions
from .raw_client import AsyncRawVoiceCloningClient, RawVoiceCloningClient
from .types.add_voice_to_model_response import AddVoiceToModelResponse
from .types.delete_voice_clone_response import DeleteVoiceCloneResponse
from .types.get_cloned_voices_response import GetClonedVoicesResponse

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


class VoiceCloningClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawVoiceCloningClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawVoiceCloningClient
        """
        return self._raw_client

    def add_voice_to_model(
        self, *, display_name: str, file: core.File, request_options: typing.Optional[RequestOptions] = None
    ) -> AddVoiceToModelResponse:
        """
        Add your voice using the Waves API.

        Parameters
        ----------
        display_name : str
            Display name for the voice clone.

        file : core.File
            See core.File for more documentation

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

        Returns
        -------
        AddVoiceToModelResponse
            Voice clone created successfully

        Examples
        --------
        from smallestai import SmallestAI

        client = SmallestAI(
            token="YOUR_TOKEN",
        )
        client.waves.voice_cloning.add_voice_to_model(
            display_name="displayName",
        )
        """
        _response = self._raw_client.add_voice_to_model(
            display_name=display_name, file=file, request_options=request_options
        )
        return _response.data

    def get_cloned_voices(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetClonedVoicesResponse:
        """
        Retrieve your cloned voices.

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

        Returns
        -------
        GetClonedVoicesResponse
            Voices retrieved successfully.

        Examples
        --------
        from smallestai import SmallestAI

        client = SmallestAI(
            token="YOUR_TOKEN",
        )
        client.waves.voice_cloning.get_cloned_voices()
        """
        _response = self._raw_client.get_cloned_voices(request_options=request_options)
        return _response.data

    def delete_voice_clone(
        self, *, voice_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteVoiceCloneResponse:
        """
        Delete a cloned voice using the new Waves API.

        Parameters
        ----------
        voice_id : str
            The unique identifier of the voice clone to delete.

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

        Returns
        -------
        DeleteVoiceCloneResponse
            Voice clone deleted successfully

        Examples
        --------
        from smallestai import SmallestAI

        client = SmallestAI(
            token="YOUR_TOKEN",
        )
        client.waves.voice_cloning.delete_voice_clone(
            voice_id="voiceId",
        )
        """
        _response = self._raw_client.delete_voice_clone(voice_id=voice_id, request_options=request_options)
        return _response.data


class AsyncVoiceCloningClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawVoiceCloningClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawVoiceCloningClient
        """
        return self._raw_client

    async def add_voice_to_model(
        self, *, display_name: str, file: core.File, request_options: typing.Optional[RequestOptions] = None
    ) -> AddVoiceToModelResponse:
        """
        Add your voice using the Waves API.

        Parameters
        ----------
        display_name : str
            Display name for the voice clone.

        file : core.File
            See core.File for more documentation

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

        Returns
        -------
        AddVoiceToModelResponse
            Voice clone created successfully

        Examples
        --------
        import asyncio

        from smallestai import AsyncSmallestAI

        client = AsyncSmallestAI(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.waves.voice_cloning.add_voice_to_model(
                display_name="displayName",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.add_voice_to_model(
            display_name=display_name, file=file, request_options=request_options
        )
        return _response.data

    async def get_cloned_voices(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetClonedVoicesResponse:
        """
        Retrieve your cloned voices.

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

        Returns
        -------
        GetClonedVoicesResponse
            Voices retrieved successfully.

        Examples
        --------
        import asyncio

        from smallestai import AsyncSmallestAI

        client = AsyncSmallestAI(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.waves.voice_cloning.get_cloned_voices()


        asyncio.run(main())
        """
        _response = await self._raw_client.get_cloned_voices(request_options=request_options)
        return _response.data

    async def delete_voice_clone(
        self, *, voice_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteVoiceCloneResponse:
        """
        Delete a cloned voice using the new Waves API.

        Parameters
        ----------
        voice_id : str
            The unique identifier of the voice clone to delete.

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

        Returns
        -------
        DeleteVoiceCloneResponse
            Voice clone deleted successfully

        Examples
        --------
        import asyncio

        from smallestai import AsyncSmallestAI

        client = AsyncSmallestAI(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.waves.voice_cloning.delete_voice_clone(
                voice_id="voiceId",
            )


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