# 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 .raw_client import AsyncRawAccessControlClient, RawAccessControlClient


class AccessControlClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAccessControlClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawAccessControlClient
        """
        return self._raw_client

    def verify_permissions(
        self,
        *,
        action: typing.Optional[str] = None,
        scope_type: typing.Optional[str] = None,
        scope_id: typing.Optional[str] = None,
        resource_type: typing.Optional[str] = None,
        resource_id: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Parameters
        ----------
        action : typing.Optional[str]

        scope_type : typing.Optional[str]

        scope_id : typing.Optional[str]

        resource_type : typing.Optional[str]

        resource_id : typing.Optional[str]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.access_control.verify_permissions()
        """
        _response = self._raw_client.verify_permissions(
            action=action,
            scope_type=scope_type,
            scope_id=scope_id,
            resource_type=resource_type,
            resource_id=resource_id,
            request_options=request_options,
        )
        return _response.data


class AsyncAccessControlClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAccessControlClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawAccessControlClient
        """
        return self._raw_client

    async def verify_permissions(
        self,
        *,
        action: typing.Optional[str] = None,
        scope_type: typing.Optional[str] = None,
        scope_id: typing.Optional[str] = None,
        resource_type: typing.Optional[str] = None,
        resource_id: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Parameters
        ----------
        action : typing.Optional[str]

        scope_type : typing.Optional[str]

        scope_id : typing.Optional[str]

        resource_type : typing.Optional[str]

        resource_id : typing.Optional[str]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.access_control.verify_permissions()


        asyncio.run(main())
        """
        _response = await self._raw_client.verify_permissions(
            action=action,
            scope_type=scope_type,
            scope_id=scope_id,
            resource_type=resource_type,
            resource_id=resource_id,
            request_options=request_options,
        )
        return _response.data
