# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from cs3.permissions.v1beta1 import permissions_api_pb2 as cs3_dot_permissions_dot_v1beta1_dot_permissions__api__pb2


class PermissionsAPIStub(object):
    """PermissionsAPI defines a service for permissions.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.CheckPermission = channel.unary_unary(
                '/cs3.permissions.v1beta1.PermissionsAPI/CheckPermission',
                request_serializer=cs3_dot_permissions_dot_v1beta1_dot_permissions__api__pb2.CheckPermissionRequest.SerializeToString,
                response_deserializer=cs3_dot_permissions_dot_v1beta1_dot_permissions__api__pb2.CheckPermissionResponse.FromString,
                )


class PermissionsAPIServicer(object):
    """PermissionsAPI defines a service for permissions.
    """

    def CheckPermission(self, request, context):
        """CheckPermission defines a method to check permission/role.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PermissionsAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CheckPermission': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckPermission,
                    request_deserializer=cs3_dot_permissions_dot_v1beta1_dot_permissions__api__pb2.CheckPermissionRequest.FromString,
                    response_serializer=cs3_dot_permissions_dot_v1beta1_dot_permissions__api__pb2.CheckPermissionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cs3.permissions.v1beta1.PermissionsAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class PermissionsAPI(object):
    """PermissionsAPI defines a service for permissions.
    """

    @staticmethod
    def CheckPermission(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/cs3.permissions.v1beta1.PermissionsAPI/CheckPermission',
            cs3_dot_permissions_dot_v1beta1_dot_permissions__api__pb2.CheckPermissionRequest.SerializeToString,
            cs3_dot_permissions_dot_v1beta1_dot_permissions__api__pb2.CheckPermissionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
