# 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.usage_fields_v1response import UsageFieldsV1Response
from .raw_client import AsyncRawFieldsClient, RawFieldsClient


class FieldsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawFieldsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawFieldsClient
        """
        return self._raw_client

    def list(
        self,
        project_id: str,
        *,
        start: typing.Optional[str] = None,
        end: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UsageFieldsV1Response:
        """
        Lists the features, models, tags, languages, and processing method used for requests in the specified project

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

        start : typing.Optional[str]
            Start date of the requested date range. Format accepted is YYYY-MM-DD

        end : typing.Optional[str]
            End date of the requested date range. Format accepted is YYYY-MM-DD

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

        Returns
        -------
        UsageFieldsV1Response
            A list of fields for a specific project

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

        client = DeepgramClient(
            api_key="YOUR_API_KEY",
        )
        client.manage.v1.projects.usage.fields.list(
            project_id="123456-7890-1234-5678-901234",
            start="start",
            end="end",
        )
        """
        _response = self._raw_client.list(project_id, start=start, end=end, request_options=request_options)
        return _response.data


class AsyncFieldsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawFieldsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawFieldsClient
        """
        return self._raw_client

    async def list(
        self,
        project_id: str,
        *,
        start: typing.Optional[str] = None,
        end: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> UsageFieldsV1Response:
        """
        Lists the features, models, tags, languages, and processing method used for requests in the specified project

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

        start : typing.Optional[str]
            Start date of the requested date range. Format accepted is YYYY-MM-DD

        end : typing.Optional[str]
            End date of the requested date range. Format accepted is YYYY-MM-DD

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

        Returns
        -------
        UsageFieldsV1Response
            A list of fields for a specific project

        Examples
        --------
        import asyncio

        from deepgram import AsyncDeepgramClient

        client = AsyncDeepgramClient(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.manage.v1.projects.usage.fields.list(
                project_id="123456-7890-1234-5678-901234",
                start="start",
                end="end",
            )


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