# 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.check_feature_access_response import CheckFeatureAccessResponse
from .raw_client import AsyncRawFeatureAccessClient, RawFeatureAccessClient


class FeatureAccessClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawFeatureAccessClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawFeatureAccessClient
        """
        return self._raw_client

    def get_feature_access(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> CheckFeatureAccessResponse:
        """
        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CheckFeatureAccessResponse
            Successful Response

        Examples
        --------
        from lark import Lark

        client = Lark(
            api_key="YOUR_API_KEY",
            base_url="https://yourhost.com/path/to/api",
        )
        client.feature_access.get_feature_access()
        """
        _response = self._raw_client.get_feature_access(request_options=request_options)
        return _response.data


class AsyncFeatureAccessClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawFeatureAccessClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawFeatureAccessClient
        """
        return self._raw_client

    async def get_feature_access(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> CheckFeatureAccessResponse:
        """
        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CheckFeatureAccessResponse
            Successful Response

        Examples
        --------
        import asyncio

        from lark import AsyncLark

        client = AsyncLark(
            api_key="YOUR_API_KEY",
            base_url="https://yourhost.com/path/to/api",
        )


        async def main() -> None:
            await client.feature_access.get_feature_access()


        asyncio.run(main())
        """
        _response = await self._raw_client.get_feature_access(request_options=request_options)
        return _response.data
