# 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.language_pydantic_model import LanguagePydanticModel
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 get_source_languages(
        self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[LanguagePydanticModel]:
        """
        Parameters
        ----------
        run_id : typing.Optional[int]

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

        Returns
        -------
        typing.List[LanguagePydanticModel]
            Successful Response

        Examples
        --------
        from camb import CambApi

        client = CambApi(
            api_key="YOUR_API_KEY",
        )
        client.languages.get_source_languages()
        """
        _response = self._raw_client.get_source_languages(run_id=run_id, request_options=request_options)
        return _response.data

    def get_target_languages(
        self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[LanguagePydanticModel]:
        """
        Parameters
        ----------
        run_id : typing.Optional[int]

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

        Returns
        -------
        typing.List[LanguagePydanticModel]
            Successful Response

        Examples
        --------
        from camb import CambApi

        client = CambApi(
            api_key="YOUR_API_KEY",
        )
        client.languages.get_target_languages()
        """
        _response = self._raw_client.get_target_languages(run_id=run_id, 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 get_source_languages(
        self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[LanguagePydanticModel]:
        """
        Parameters
        ----------
        run_id : typing.Optional[int]

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

        Returns
        -------
        typing.List[LanguagePydanticModel]
            Successful Response

        Examples
        --------
        import asyncio

        from camb import AsyncCambApi

        client = AsyncCambApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.languages.get_source_languages()


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

    async def get_target_languages(
        self, *, run_id: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[LanguagePydanticModel]:
        """
        Parameters
        ----------
        run_id : typing.Optional[int]

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

        Returns
        -------
        typing.List[LanguagePydanticModel]
            Successful Response

        Examples
        --------
        import asyncio

        from camb import AsyncCambApi

        client = AsyncCambApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.languages.get_target_languages()


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