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

from paperpilot_common.protobuf.paper import paper_pb2 as paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.AddPaper = channel.unary_unary(
            "/paper.PaperService/AddPaper",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
        )
        self.UpdatePaper = channel.unary_unary(
            "/paper.PaperService/UpdatePaper",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
        )
        self.UpdateAttachment = channel.unary_unary(
            "/paper.PaperService/UpdateAttachment",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UpdateAttachmentRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
        )


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

    def AddPaper(self, request, context):
        """添加论文"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdatePaper(self, request, context):
        """更新论文"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateAttachment(self, request, context):
        """更新论文附件"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_PaperServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "AddPaper": grpc.unary_unary_rpc_method_handler(
            servicer.AddPaper,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
        ),
        "UpdatePaper": grpc.unary_unary_rpc_method_handler(
            servicer.UpdatePaper,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
        ),
        "UpdateAttachment": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateAttachment,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UpdateAttachmentRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("paper.PaperService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def AddPaper(
        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,
            "/paper.PaperService/AddPaper",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpdatePaper(
        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,
            "/paper.PaperService/UpdatePaper",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpdateAttachment(
        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,
            "/paper.PaperService/UpdateAttachment",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UpdateAttachmentRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )


class PaperPublicServiceStub(object):
    """论文公开接口"""

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListPaper = channel.unary_unary(
            "/paper.PaperPublicService/ListPaper",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.ListPaperRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.ListPaperResponse.FromString,
        )
        self.GetPaper = channel.unary_unary(
            "/paper.PaperPublicService/GetPaper",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperId.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
        )
        self.CreatePaper = channel.unary_unary(
            "/paper.PaperPublicService/CreatePaper",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.CreatePaperRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
        )
        self.CreatePaperByLink = channel.unary_unary(
            "/paper.PaperPublicService/CreatePaperByLink",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.CreatePaperByLinkRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
        )
        self.UpdatePaper = channel.unary_unary(
            "/paper.PaperPublicService/UpdatePaper",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
        )
        self.UploadAttachment = channel.unary_unary(
            "/paper.PaperPublicService/UploadAttachment",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UploadAttachmentRequest.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UploadAttachmentResponse.FromString,
        )
        self.DeletePaper = channel.unary_unary(
            "/paper.PaperPublicService/DeletePaper",
            request_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperId.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )


class PaperPublicServiceServicer(object):
    """论文公开接口"""

    def ListPaper(self, request, context):
        """获取论文列表"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetPaper(self, request, context):
        """获取论文详情"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreatePaper(self, request, context):
        """添加论文"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreatePaperByLink(self, request, context):
        """从链接创建论文"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdatePaper(self, request, context):
        """更新论文"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UploadAttachment(self, request, context):
        """上传附件"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def DeletePaper(self, request, context):
        """删除论文"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_PaperPublicServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "ListPaper": grpc.unary_unary_rpc_method_handler(
            servicer.ListPaper,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.ListPaperRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.ListPaperResponse.SerializeToString,
        ),
        "GetPaper": grpc.unary_unary_rpc_method_handler(
            servicer.GetPaper,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperId.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
        ),
        "CreatePaper": grpc.unary_unary_rpc_method_handler(
            servicer.CreatePaper,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.CreatePaperRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
        ),
        "CreatePaperByLink": grpc.unary_unary_rpc_method_handler(
            servicer.CreatePaperByLink,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.CreatePaperByLinkRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
        ),
        "UpdatePaper": grpc.unary_unary_rpc_method_handler(
            servicer.UpdatePaper,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
        ),
        "UploadAttachment": grpc.unary_unary_rpc_method_handler(
            servicer.UploadAttachment,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UploadAttachmentRequest.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UploadAttachmentResponse.SerializeToString,
        ),
        "DeletePaper": grpc.unary_unary_rpc_method_handler(
            servicer.DeletePaper,
            request_deserializer=paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperId.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("paper.PaperPublicService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class PaperPublicService(object):
    """论文公开接口"""

    @staticmethod
    def ListPaper(
        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,
            "/paper.PaperPublicService/ListPaper",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.ListPaperRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.ListPaperResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def GetPaper(
        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,
            "/paper.PaperPublicService/GetPaper",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperId.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CreatePaper(
        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,
            "/paper.PaperPublicService/CreatePaper",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.CreatePaperRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CreatePaperByLink(
        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,
            "/paper.PaperPublicService/CreatePaperByLink",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.CreatePaperByLinkRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpdatePaper(
        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,
            "/paper.PaperPublicService/UpdatePaper",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperDetail.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UploadAttachment(
        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,
            "/paper.PaperPublicService/UploadAttachment",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UploadAttachmentRequest.SerializeToString,
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.UploadAttachmentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def DeletePaper(
        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,
            "/paper.PaperPublicService/DeletePaper",
            paperpilot__common_dot_protobuf_dot_paper_dot_paper__pb2.PaperId.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
