# 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.im import im_pb2 as paperpilot__common_dot_protobuf_dot_im_dot_im__pb2


class IMServiceStub(object):
    """即时通讯接口"""

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateUser = channel.unary_unary(
            "/im.IMService/CreateUser",
            request_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.CreateUserRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.UpdateUser = channel.unary_unary(
            "/im.IMService/UpdateUser",
            request_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.UpdateUserRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.CreateWorkGroup = channel.unary_unary(
            "/im.IMService/CreateWorkGroup",
            request_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.CreateWorkGroupRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.UpdateWorkGroup = channel.unary_unary(
            "/im.IMService/UpdateWorkGroup",
            request_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.UpdateWorkGroupRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.DeleteWorkGroup = channel.unary_unary(
            "/im.IMService/DeleteWorkGroup",
            request_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.DeleteWorkGroupRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.InviteUserToGroup = channel.unary_unary(
            "/im.IMService/InviteUserToGroup",
            request_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.InviteUserToGroupRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.RemoveUserFromGroup = channel.unary_unary(
            "/im.IMService/RemoveUserFromGroup",
            request_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.RemoveUserFromGroupRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )


class IMServiceServicer(object):
    """即时通讯接口"""

    def CreateUser(self, request, context):
        """新建用户"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateUser(self, request, context):
        """更新用户"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreateWorkGroup(self, request, context):
        """创建Work群组"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateWorkGroup(self, request, context):
        """更新Work群组"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def DeleteWorkGroup(self, request, context):
        """删除Work群组"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def InviteUserToGroup(self, request, context):
        """邀请用户加入群组"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def RemoveUserFromGroup(self, request, context):
        """从群组中移除用户"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_IMServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "CreateUser": grpc.unary_unary_rpc_method_handler(
            servicer.CreateUser,
            request_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.CreateUserRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "UpdateUser": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateUser,
            request_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.UpdateUserRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "CreateWorkGroup": grpc.unary_unary_rpc_method_handler(
            servicer.CreateWorkGroup,
            request_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.CreateWorkGroupRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "UpdateWorkGroup": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateWorkGroup,
            request_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.UpdateWorkGroupRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "DeleteWorkGroup": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteWorkGroup,
            request_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.DeleteWorkGroupRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "InviteUserToGroup": grpc.unary_unary_rpc_method_handler(
            servicer.InviteUserToGroup,
            request_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.InviteUserToGroupRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "RemoveUserFromGroup": grpc.unary_unary_rpc_method_handler(
            servicer.RemoveUserFromGroup,
            request_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.RemoveUserFromGroupRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("im.IMService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class IMService(object):
    """即时通讯接口"""

    @staticmethod
    def CreateUser(
        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,
            "/im.IMService/CreateUser",
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.CreateUserRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpdateUser(
        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,
            "/im.IMService/UpdateUser",
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.UpdateUserRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def CreateWorkGroup(
        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,
            "/im.IMService/CreateWorkGroup",
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.CreateWorkGroupRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def UpdateWorkGroup(
        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,
            "/im.IMService/UpdateWorkGroup",
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.UpdateWorkGroupRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def DeleteWorkGroup(
        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,
            "/im.IMService/DeleteWorkGroup",
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.DeleteWorkGroupRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def InviteUserToGroup(
        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,
            "/im.IMService/InviteUserToGroup",
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.InviteUserToGroupRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )

    @staticmethod
    def RemoveUserFromGroup(
        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,
            "/im.IMService/RemoveUserFromGroup",
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.RemoveUserFromGroupRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )


class IMPublicServiceStub(object):
    """即时通讯公开接口"""

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

        Args:
            channel: A grpc.Channel.
        """
        self.IMAuth = channel.unary_unary(
            "/im.IMPublicService/IMAuth",
            request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            response_deserializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.IMAuthResponse.FromString,
        )


class IMPublicServiceServicer(object):
    """即时通讯公开接口"""

    def IMAuth(self, request, context):
        """IM认证"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_IMPublicServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "IMAuth": grpc.unary_unary_rpc_method_handler(
            servicer.IMAuth,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.IMAuthResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("im.IMPublicService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class IMPublicService(object):
    """即时通讯公开接口"""

    @staticmethod
    def IMAuth(
        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,
            "/im.IMPublicService/IMAuth",
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            paperpilot__common_dot_protobuf_dot_im_dot_im__pb2.IMAuthResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
        )
