# -*- coding: utf-8 -*-
# Generated by https://github.com/connectrpc/connect-python.  DO NOT EDIT!
# source: chatto/admin/v1/permissions.proto

from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping
from typing import Protocol

from connectrpc.client import ConnectClient, ConnectClientSync
from connectrpc.code import Code
from connectrpc.compression import Compression
from connectrpc.errors import ConnectError
from connectrpc.interceptor import Interceptor, InterceptorSync
from connectrpc.method import IdempotencyLevel, MethodInfo
from connectrpc.request import Headers, RequestContext
from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync
import chatto.admin.v1.permissions_pb2 as chatto_dot_admin_dot_v1_dot_permissions__pb2


class AdminPermissionService(Protocol):
    async def get_role_permission_tier_matrix(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def get_role_permission_matrix(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def list_role_permission_decisions(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def get_user_permission_matrix(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def list_user_permission_decisions(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def explain_permissions(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def set_role_permission(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")

    async def set_user_permission(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")


class AdminPermissionServiceASGIApplication(ConnectASGIApplication[AdminPermissionService]):
    def __init__(self, service: AdminPermissionService | AsyncGenerator[AdminPermissionService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
        super().__init__(
            service=service,
            endpoints=lambda svc: {
                "/chatto.admin.v1.AdminPermissionService/GetRolePermissionTierMatrix": Endpoint.unary(
                    method=MethodInfo(
                        name="GetRolePermissionTierMatrix",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.get_role_permission_tier_matrix,
                ),
                "/chatto.admin.v1.AdminPermissionService/GetRolePermissionMatrix": Endpoint.unary(
                    method=MethodInfo(
                        name="GetRolePermissionMatrix",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.get_role_permission_matrix,
                ),
                "/chatto.admin.v1.AdminPermissionService/ListRolePermissionDecisions": Endpoint.unary(
                    method=MethodInfo(
                        name="ListRolePermissionDecisions",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.list_role_permission_decisions,
                ),
                "/chatto.admin.v1.AdminPermissionService/GetUserPermissionMatrix": Endpoint.unary(
                    method=MethodInfo(
                        name="GetUserPermissionMatrix",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.get_user_permission_matrix,
                ),
                "/chatto.admin.v1.AdminPermissionService/ListUserPermissionDecisions": Endpoint.unary(
                    method=MethodInfo(
                        name="ListUserPermissionDecisions",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.list_user_permission_decisions,
                ),
                "/chatto.admin.v1.AdminPermissionService/ExplainPermissions": Endpoint.unary(
                    method=MethodInfo(
                        name="ExplainPermissions",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.explain_permissions,
                ),
                "/chatto.admin.v1.AdminPermissionService/SetRolePermission": Endpoint.unary(
                    method=MethodInfo(
                        name="SetRolePermission",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.set_role_permission,
                ),
                "/chatto.admin.v1.AdminPermissionService/SetUserPermission": Endpoint.unary(
                    method=MethodInfo(
                        name="SetUserPermission",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=svc.set_user_permission,
                ),
            },
            interceptors=interceptors,
            read_max_bytes=read_max_bytes,
            compressions=compressions,
        )

    @property
    def path(self) -> str:
        """Returns the URL path to mount the application to when serving multiple applications."""
        return "/chatto.admin.v1.AdminPermissionService"


class AdminPermissionServiceClient(ConnectClient):
    async def get_role_permission_tier_matrix(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetRolePermissionTierMatrix",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def get_role_permission_matrix(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetRolePermissionMatrix",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def list_role_permission_decisions(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="ListRolePermissionDecisions",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def get_user_permission_matrix(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetUserPermissionMatrix",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def list_user_permission_decisions(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="ListUserPermissionDecisions",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def explain_permissions(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="ExplainPermissions",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def set_role_permission(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="SetRolePermission",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    async def set_user_permission(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse:
        return await self.execute_unary(
            request=request,
            method=MethodInfo(
                name="SetUserPermission",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )


class AdminPermissionServiceSync(Protocol):
    def get_role_permission_tier_matrix(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def get_role_permission_matrix(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def list_role_permission_decisions(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def get_user_permission_matrix(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def list_user_permission_decisions(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def explain_permissions(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def set_role_permission(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
    def set_user_permission(self, request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest, ctx: RequestContext) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse:
        raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")


class AdminPermissionServiceWSGIApplication(ConnectWSGIApplication):
    def __init__(self, service: AdminPermissionServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
        super().__init__(
            endpoints={
                "/chatto.admin.v1.AdminPermissionService/GetRolePermissionTierMatrix": EndpointSync.unary(
                    method=MethodInfo(
                        name="GetRolePermissionTierMatrix",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.get_role_permission_tier_matrix,
                ),
                "/chatto.admin.v1.AdminPermissionService/GetRolePermissionMatrix": EndpointSync.unary(
                    method=MethodInfo(
                        name="GetRolePermissionMatrix",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.get_role_permission_matrix,
                ),
                "/chatto.admin.v1.AdminPermissionService/ListRolePermissionDecisions": EndpointSync.unary(
                    method=MethodInfo(
                        name="ListRolePermissionDecisions",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.list_role_permission_decisions,
                ),
                "/chatto.admin.v1.AdminPermissionService/GetUserPermissionMatrix": EndpointSync.unary(
                    method=MethodInfo(
                        name="GetUserPermissionMatrix",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.get_user_permission_matrix,
                ),
                "/chatto.admin.v1.AdminPermissionService/ListUserPermissionDecisions": EndpointSync.unary(
                    method=MethodInfo(
                        name="ListUserPermissionDecisions",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.list_user_permission_decisions,
                ),
                "/chatto.admin.v1.AdminPermissionService/ExplainPermissions": EndpointSync.unary(
                    method=MethodInfo(
                        name="ExplainPermissions",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.explain_permissions,
                ),
                "/chatto.admin.v1.AdminPermissionService/SetRolePermission": EndpointSync.unary(
                    method=MethodInfo(
                        name="SetRolePermission",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.set_role_permission,
                ),
                "/chatto.admin.v1.AdminPermissionService/SetUserPermission": EndpointSync.unary(
                    method=MethodInfo(
                        name="SetUserPermission",
                        service_name="chatto.admin.v1.AdminPermissionService",
                        input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest,
                        output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse,
                        idempotency_level=IdempotencyLevel.UNKNOWN,
                    ),
                    function=service.set_user_permission,
                ),
            },
            interceptors=interceptors,
            read_max_bytes=read_max_bytes,
            compressions=compressions,
        )

    @property
    def path(self) -> str:
        """Returns the URL path to mount the application to when serving multiple applications."""
        return "/chatto.admin.v1.AdminPermissionService"


class AdminPermissionServiceClientSync(ConnectClientSync):
    def get_role_permission_tier_matrix(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetRolePermissionTierMatrix",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionTierMatrixResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def get_role_permission_matrix(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetRolePermissionMatrix",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetRolePermissionMatrixResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def list_role_permission_decisions(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="ListRolePermissionDecisions",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListRolePermissionDecisionsResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def get_user_permission_matrix(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="GetUserPermissionMatrix",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.GetUserPermissionMatrixResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def list_user_permission_decisions(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="ListUserPermissionDecisions",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ListUserPermissionDecisionsResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def explain_permissions(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="ExplainPermissions",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.ExplainPermissionsResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def set_role_permission(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="SetRolePermission",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetRolePermissionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )

    def set_user_permission(
        self,
        request: chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest,
        *,
        headers: Headers | Mapping[str, str] | None = None,
        timeout_ms: int | None = None,
    ) -> chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse:
        return self.execute_unary(
            request=request,
            method=MethodInfo(
                name="SetUserPermission",
                service_name="chatto.admin.v1.AdminPermissionService",
                input=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionRequest,
                output=chatto_dot_admin_dot_v1_dot_permissions__pb2.SetUserPermissionResponse,
                idempotency_level=IdempotencyLevel.UNKNOWN,
            ),
            headers=headers,
            timeout_ms=timeout_ms,
        )
