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

from cs3.sharing.link.v1beta1 import link_api_pb2 as cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2


class LinkAPIStub(object):
    """PublicShare Provider API

    The Public Share Provider API is meant to manipulate public shares
    also called public links.

    Access to public shares can be limitted by a password. The share
    provider must store this password in a secure manner e.g. hashed
    with the bcrypt algorithm.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
    "OPTIONAL" in this document are to be interpreted as described in
    RFC 2119.

    The following are global requirements that apply to all methods:
    Any method MUST return CODE_OK on a succesful operation.
    Any method MAY return NOT_IMPLEMENTED.
    Any method MAY return INTERNAL.
    Any method MAY return UNKNOWN.
    Any method MAY return UNAUTHENTICATED.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreatePublicShare = channel.unary_unary(
                '/cs3.sharing.link.v1beta1.LinkAPI/CreatePublicShare',
                request_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.CreatePublicShareRequest.SerializeToString,
                response_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.CreatePublicShareResponse.FromString,
                )
        self.RemovePublicShare = channel.unary_unary(
                '/cs3.sharing.link.v1beta1.LinkAPI/RemovePublicShare',
                request_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.RemovePublicShareRequest.SerializeToString,
                response_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.RemovePublicShareResponse.FromString,
                )
        self.GetPublicShare = channel.unary_unary(
                '/cs3.sharing.link.v1beta1.LinkAPI/GetPublicShare',
                request_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareRequest.SerializeToString,
                response_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareResponse.FromString,
                )
        self.GetPublicShareByToken = channel.unary_unary(
                '/cs3.sharing.link.v1beta1.LinkAPI/GetPublicShareByToken',
                request_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareByTokenRequest.SerializeToString,
                response_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareByTokenResponse.FromString,
                )
        self.ListPublicShares = channel.unary_unary(
                '/cs3.sharing.link.v1beta1.LinkAPI/ListPublicShares',
                request_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.ListPublicSharesRequest.SerializeToString,
                response_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.ListPublicSharesResponse.FromString,
                )
        self.UpdatePublicShare = channel.unary_unary(
                '/cs3.sharing.link.v1beta1.LinkAPI/UpdatePublicShare',
                request_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.UpdatePublicShareRequest.SerializeToString,
                response_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.UpdatePublicShareResponse.FromString,
                )


class LinkAPIServicer(object):
    """PublicShare Provider API

    The Public Share Provider API is meant to manipulate public shares
    also called public links.

    Access to public shares can be limitted by a password. The share
    provider must store this password in a secure manner e.g. hashed
    with the bcrypt algorithm.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
    "OPTIONAL" in this document are to be interpreted as described in
    RFC 2119.

    The following are global requirements that apply to all methods:
    Any method MUST return CODE_OK on a succesful operation.
    Any method MAY return NOT_IMPLEMENTED.
    Any method MAY return INTERNAL.
    Any method MAY return UNKNOWN.
    Any method MAY return UNAUTHENTICATED.
    """

    def CreatePublicShare(self, request, context):
        """Creates a new share.
        MUST return CODE_NOT_FOUND if the resource reference does not exist.
        MUST return CODE_ALREADY_EXISTS if the share already exists for the 4-tuple consisting of
        (owner, shared_resource, grantee).
        New shares MUST be created in the state SHARE_STATE_PENDING.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RemovePublicShare(self, request, context):
        """Removes a share.
        MUST return CODE_NOT_FOUND if the share reference does not exist.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetPublicShare(self, request, context):
        """Gets share information for a single share.
        MUST return CODE_NOT_FOUND if the share reference does not exist.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetPublicShareByToken(self, request, context):
        """Gets share information for a single share by its unlisted token.
        MUST return CODE_NOT_FOUND if the share does not exist.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListPublicShares(self, request, context):
        """List the shares the authenticated principal has created,
        both as owner and creator. If a filter is specified, only
        shares satisfying the filter MUST be returned.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdatePublicShare(self, request, context):
        """Updates a share.
        MUST return CODE_NOT_FOUND if the share reference does not exist.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_LinkAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreatePublicShare': grpc.unary_unary_rpc_method_handler(
                    servicer.CreatePublicShare,
                    request_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.CreatePublicShareRequest.FromString,
                    response_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.CreatePublicShareResponse.SerializeToString,
            ),
            'RemovePublicShare': grpc.unary_unary_rpc_method_handler(
                    servicer.RemovePublicShare,
                    request_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.RemovePublicShareRequest.FromString,
                    response_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.RemovePublicShareResponse.SerializeToString,
            ),
            'GetPublicShare': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPublicShare,
                    request_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareRequest.FromString,
                    response_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareResponse.SerializeToString,
            ),
            'GetPublicShareByToken': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPublicShareByToken,
                    request_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareByTokenRequest.FromString,
                    response_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareByTokenResponse.SerializeToString,
            ),
            'ListPublicShares': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPublicShares,
                    request_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.ListPublicSharesRequest.FromString,
                    response_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.ListPublicSharesResponse.SerializeToString,
            ),
            'UpdatePublicShare': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdatePublicShare,
                    request_deserializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.UpdatePublicShareRequest.FromString,
                    response_serializer=cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.UpdatePublicShareResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cs3.sharing.link.v1beta1.LinkAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class LinkAPI(object):
    """PublicShare Provider API

    The Public Share Provider API is meant to manipulate public shares
    also called public links.

    Access to public shares can be limitted by a password. The share
    provider must store this password in a secure manner e.g. hashed
    with the bcrypt algorithm.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
    "OPTIONAL" in this document are to be interpreted as described in
    RFC 2119.

    The following are global requirements that apply to all methods:
    Any method MUST return CODE_OK on a succesful operation.
    Any method MAY return NOT_IMPLEMENTED.
    Any method MAY return INTERNAL.
    Any method MAY return UNKNOWN.
    Any method MAY return UNAUTHENTICATED.
    """

    @staticmethod
    def CreatePublicShare(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.sharing.link.v1beta1.LinkAPI/CreatePublicShare',
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.CreatePublicShareRequest.SerializeToString,
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.CreatePublicShareResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RemovePublicShare(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.sharing.link.v1beta1.LinkAPI/RemovePublicShare',
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.RemovePublicShareRequest.SerializeToString,
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.RemovePublicShareResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetPublicShare(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.sharing.link.v1beta1.LinkAPI/GetPublicShare',
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareRequest.SerializeToString,
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetPublicShareByToken(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.sharing.link.v1beta1.LinkAPI/GetPublicShareByToken',
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareByTokenRequest.SerializeToString,
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.GetPublicShareByTokenResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListPublicShares(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.sharing.link.v1beta1.LinkAPI/ListPublicShares',
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.ListPublicSharesRequest.SerializeToString,
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.ListPublicSharesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UpdatePublicShare(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.sharing.link.v1beta1.LinkAPI/UpdatePublicShare',
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.UpdatePublicShareRequest.SerializeToString,
            cs3_dot_sharing_dot_link_dot_v1beta1_dot_link__api__pb2.UpdatePublicShareResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
