# 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.delete_pronunciation_dict_response import DeletePronunciationDictResponse
from ..types.pronunciation_dict import PronunciationDict
from ..types.pronunciation_item import PronunciationItem
from ..types.update_pronunciation_dict_response import UpdatePronunciationDictResponse
from .raw_client import AsyncRawPronunciationDictionariesClient, RawPronunciationDictionariesClient

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


class PronunciationDictionariesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawPronunciationDictionariesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawPronunciationDictionariesClient
        """
        return self._raw_client

    def get_pronunciation_dicts(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[PronunciationDict]:
        """
        Retrieve all pronunciation dictionaries for the authenticated user

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

        Returns
        -------
        typing.List[PronunciationDict]
            List of pronunciation dictionaries

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

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

    def create_pronunciation_dict(
        self, *, items: typing.Sequence[PronunciationItem], request_options: typing.Optional[RequestOptions] = None
    ) -> PronunciationDict:
        """
        Create a new pronunciation dictionary for the authenticated user

        Parameters
        ----------
        items : typing.Sequence[PronunciationItem]
            List of word-pronunciation pairs to create

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

        Returns
        -------
        PronunciationDict
            Successfully created pronunciation dictionary

        Examples
        --------
        from smallestai import SmallestAI
        from smallestai.waves import PronunciationItem

        client = SmallestAI(
            token="YOUR_TOKEN",
        )
        client.waves.pronunciation_dictionaries.create_pronunciation_dict(
            items=[
                PronunciationItem(
                    word="mysql",
                    pronunciation="my-sequel",
                )
            ],
        )
        """
        _response = self._raw_client.create_pronunciation_dict(items=items, request_options=request_options)
        return _response.data

    def update_pronunciation_dict(
        self,
        *,
        id: str,
        items: typing.Sequence[PronunciationItem],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdatePronunciationDictResponse:
        """
        Update an existing pronunciation dictionary for the authenticated user

        Parameters
        ----------
        id : str
            ID of the pronunciation dictionary to update

        items : typing.Sequence[PronunciationItem]
            Updated list of word-pronunciation pairs

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

        Returns
        -------
        UpdatePronunciationDictResponse
            Successfully updated pronunciation dictionary

        Examples
        --------
        from smallestai import SmallestAI
        from smallestai.waves import PronunciationItem

        client = SmallestAI(
            token="YOUR_TOKEN",
        )
        client.waves.pronunciation_dictionaries.update_pronunciation_dict(
            id="64f1234567890abcdef12345",
            items=[
                PronunciationItem(
                    word="mysql",
                    pronunciation="my-sequel",
                )
            ],
        )
        """
        _response = self._raw_client.update_pronunciation_dict(id=id, items=items, request_options=request_options)
        return _response.data

    def delete_pronunciation_dict(
        self, *, id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> DeletePronunciationDictResponse:
        """
        Delete an existing pronunciation dictionary for the authenticated user

        Parameters
        ----------
        id : str
            ID of the pronunciation dictionary to delete

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

        Returns
        -------
        DeletePronunciationDictResponse
            Successfully deleted pronunciation dictionary

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

        client = SmallestAI(
            token="YOUR_TOKEN",
        )
        client.waves.pronunciation_dictionaries.delete_pronunciation_dict(
            id="64f1234567890abcdef12345",
        )
        """
        _response = self._raw_client.delete_pronunciation_dict(id=id, request_options=request_options)
        return _response.data


class AsyncPronunciationDictionariesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawPronunciationDictionariesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawPronunciationDictionariesClient
        """
        return self._raw_client

    async def get_pronunciation_dicts(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[PronunciationDict]:
        """
        Retrieve all pronunciation dictionaries for the authenticated user

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

        Returns
        -------
        typing.List[PronunciationDict]
            List of pronunciation dictionaries

        Examples
        --------
        import asyncio

        from smallestai import AsyncSmallestAI

        client = AsyncSmallestAI(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.waves.pronunciation_dictionaries.get_pronunciation_dicts()


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

    async def create_pronunciation_dict(
        self, *, items: typing.Sequence[PronunciationItem], request_options: typing.Optional[RequestOptions] = None
    ) -> PronunciationDict:
        """
        Create a new pronunciation dictionary for the authenticated user

        Parameters
        ----------
        items : typing.Sequence[PronunciationItem]
            List of word-pronunciation pairs to create

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

        Returns
        -------
        PronunciationDict
            Successfully created pronunciation dictionary

        Examples
        --------
        import asyncio

        from smallestai import AsyncSmallestAI
        from smallestai.waves import PronunciationItem

        client = AsyncSmallestAI(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.waves.pronunciation_dictionaries.create_pronunciation_dict(
                items=[
                    PronunciationItem(
                        word="mysql",
                        pronunciation="my-sequel",
                    )
                ],
            )


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

    async def update_pronunciation_dict(
        self,
        *,
        id: str,
        items: typing.Sequence[PronunciationItem],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UpdatePronunciationDictResponse:
        """
        Update an existing pronunciation dictionary for the authenticated user

        Parameters
        ----------
        id : str
            ID of the pronunciation dictionary to update

        items : typing.Sequence[PronunciationItem]
            Updated list of word-pronunciation pairs

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

        Returns
        -------
        UpdatePronunciationDictResponse
            Successfully updated pronunciation dictionary

        Examples
        --------
        import asyncio

        from smallestai import AsyncSmallestAI
        from smallestai.waves import PronunciationItem

        client = AsyncSmallestAI(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.waves.pronunciation_dictionaries.update_pronunciation_dict(
                id="64f1234567890abcdef12345",
                items=[
                    PronunciationItem(
                        word="mysql",
                        pronunciation="my-sequel",
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_pronunciation_dict(
            id=id, items=items, request_options=request_options
        )
        return _response.data

    async def delete_pronunciation_dict(
        self, *, id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> DeletePronunciationDictResponse:
        """
        Delete an existing pronunciation dictionary for the authenticated user

        Parameters
        ----------
        id : str
            ID of the pronunciation dictionary to delete

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

        Returns
        -------
        DeletePronunciationDictResponse
            Successfully deleted pronunciation dictionary

        Examples
        --------
        import asyncio

        from smallestai import AsyncSmallestAI

        client = AsyncSmallestAI(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.waves.pronunciation_dictionaries.delete_pronunciation_dict(
                id="64f1234567890abcdef12345",
            )


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