# 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.languages_response import LanguagesResponse
from ....types.order_item_kind import OrderItemKind
from .raw_client import AsyncRawLanguagesClient, RawLanguagesClient


class LanguagesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawLanguagesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawLanguagesClient
        """
        return self._raw_client

    def list(
        self, order_item_kind: OrderItemKind, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LanguagesResponse:
        """
        Returns the available languages for a given order item kind.

        Parameters
        ----------
        order_item_kind : OrderItemKind
            The kind of order item.

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

        Returns
        -------
        LanguagesResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.productions.orders.languages.list(
            order_item_kind="dub",
        )
        """
        _response = self._raw_client.list(order_item_kind, request_options=request_options)
        return _response.data


class AsyncLanguagesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawLanguagesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawLanguagesClient
        """
        return self._raw_client

    async def list(
        self, order_item_kind: OrderItemKind, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LanguagesResponse:
        """
        Returns the available languages for a given order item kind.

        Parameters
        ----------
        order_item_kind : OrderItemKind
            The kind of order item.

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

        Returns
        -------
        LanguagesResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.productions.orders.languages.list(
                order_item_kind="dub",
            )


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