# 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_model_v1response import GetModelV1Response
from .....types.list_models_v1response import ListModelsV1Response
from .raw_client import AsyncRawModelsClient, RawModelsClient


class ModelsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawModelsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawModelsClient
        """
        return self._raw_client

    def list(
        self,
        project_id: str,
        *,
        include_outdated: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListModelsV1Response:
        """
        Returns metadata on all the latest models that a specific project has access to, including non-public models

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        include_outdated : typing.Optional[bool]
            returns non-latest versions of models

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

        Returns
        -------
        ListModelsV1Response
            A list of models

        Examples
        --------
        from deepgram import DeepgramClient

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.manage.v1.projects.models.list(
            project_id="123456-7890-1234-5678-901234",
            include_outdated=True,
        )
        """
        _response = self._raw_client.list(
            project_id, include_outdated=include_outdated, request_options=request_options
        )
        return _response.data

    def get(
        self, project_id: str, model_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetModelV1Response:
        """
        Returns metadata for a specific model

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        model_id : str
            The specific UUID of the model

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

        Returns
        -------
        GetModelV1Response
            A model object that can be either STT or TTS

        Examples
        --------
        from deepgram import DeepgramClient

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.manage.v1.projects.models.get(
            project_id="123456-7890-1234-5678-901234",
            model_id="af6e9977-99f6-4d8f-b6f5-dfdf6fb6e291",
        )
        """
        _response = self._raw_client.get(project_id, model_id, request_options=request_options)
        return _response.data


class AsyncModelsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawModelsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawModelsClient
        """
        return self._raw_client

    async def list(
        self,
        project_id: str,
        *,
        include_outdated: typing.Optional[bool] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ListModelsV1Response:
        """
        Returns metadata on all the latest models that a specific project has access to, including non-public models

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        include_outdated : typing.Optional[bool]
            returns non-latest versions of models

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

        Returns
        -------
        ListModelsV1Response
            A list of models

        Examples
        --------
        import asyncio

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.manage.v1.projects.models.list(
                project_id="123456-7890-1234-5678-901234",
                include_outdated=True,
            )


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

    async def get(
        self, project_id: str, model_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> GetModelV1Response:
        """
        Returns metadata for a specific model

        Parameters
        ----------
        project_id : str
            The unique identifier of the project

        model_id : str
            The specific UUID of the model

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

        Returns
        -------
        GetModelV1Response
            A model object that can be either STT or TTS

        Examples
        --------
        import asyncio

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.manage.v1.projects.models.get(
                project_id="123456-7890-1234-5678-901234",
                model_id="af6e9977-99f6-4d8f-b6f5-dfdf6fb6e291",
            )


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