# 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.folder import Folder
from .raw_client import AsyncRawFoldersClient, RawFoldersClient

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


class FoldersClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawFoldersClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawFoldersClient
        """
        return self._raw_client

    def list_folders(
        self,
        *,
        limit: typing.Optional[int] = None,
        search_query: typing.Optional[str] = None,
        run_id: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[Folder]:
        """
        Parameters
        ----------
        limit : typing.Optional[int]

        search_query : typing.Optional[str]

        run_id : typing.Optional[int]

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

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

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

        client = CambApi(
            api_key="YOUR_API_KEY",
        )
        client.folders.list_folders()
        """
        _response = self._raw_client.list_folders(
            limit=limit, search_query=search_query, run_id=run_id, request_options=request_options
        )
        return _response.data

    def create_folder(
        self,
        *,
        folder_name: str,
        run_id: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Parameters
        ----------
        folder_name : str

        run_id : typing.Optional[int]

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

        Returns
        -------
        typing.Any
            Successful Response

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

        client = CambApi(
            api_key="YOUR_API_KEY",
        )
        client.folders.create_folder(
            folder_name="folder_name",
        )
        """
        _response = self._raw_client.create_folder(
            folder_name=folder_name, run_id=run_id, request_options=request_options
        )
        return _response.data


class AsyncFoldersClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawFoldersClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawFoldersClient
        """
        return self._raw_client

    async def list_folders(
        self,
        *,
        limit: typing.Optional[int] = None,
        search_query: typing.Optional[str] = None,
        run_id: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[Folder]:
        """
        Parameters
        ----------
        limit : typing.Optional[int]

        search_query : typing.Optional[str]

        run_id : typing.Optional[int]

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

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

        Examples
        --------
        import asyncio

        from camb import AsyncCambApi

        client = AsyncCambApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.folders.list_folders()


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

    async def create_folder(
        self,
        *,
        folder_name: str,
        run_id: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Any:
        """
        Parameters
        ----------
        folder_name : str

        run_id : typing.Optional[int]

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

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from camb import AsyncCambApi

        client = AsyncCambApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.folders.create_folder(
                folder_name="folder_name",
            )


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