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

from terrascope_api.models import permission_pb2 as permission__pb2


class PermissionApiStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.create = channel.unary_unary(
                '/oi.papi.permission.PermissionApi/create',
                request_serializer=permission__pb2.PermissionCreateRequest.SerializeToString,
                response_deserializer=permission__pb2.PermissionCreateResponse.FromString,
                )
        self.delete = channel.unary_unary(
                '/oi.papi.permission.PermissionApi/delete',
                request_serializer=permission__pb2.PermissionDeleteRequest.SerializeToString,
                response_deserializer=permission__pb2.PermissionDeleteResponse.FromString,
                )


class PermissionApiServicer(object):
    """Missing associated documentation comment in .proto file."""

    def create(self, request, context):
        """
        Adds Permissions for the specified users to the specified resources.
        Works for all resource types, but does not add permissions for any dependent or child resources.
        Subject ID could be a User, a UserCollection or the root subject.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        Removes Permissions for the specified users from the specified resources.
        Works for all resource types., but does not remove Permissions for any dependent or child resources.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PermissionApiServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=permission__pb2.PermissionCreateRequest.FromString,
                    response_serializer=permission__pb2.PermissionCreateResponse.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=permission__pb2.PermissionDeleteRequest.FromString,
                    response_serializer=permission__pb2.PermissionDeleteResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'oi.papi.permission.PermissionApi', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class PermissionApi(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def create(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, '/oi.papi.permission.PermissionApi/create',
            permission__pb2.PermissionCreateRequest.SerializeToString,
            permission__pb2.PermissionCreateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def delete(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, '/oi.papi.permission.PermissionApi/delete',
            permission__pb2.PermissionDeleteRequest.SerializeToString,
            permission__pb2.PermissionDeleteResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
