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

from avikom.generic import user_pb2 as avikom_dot_generic_dot_user__pb2
from avikom.generic import user_profile_pb2 as avikom_dot_generic_dot_user__profile__pb2


class UserServiceStub(object):
    """*
    A service to create users and to get additional information about an incomplete user object. 
    For information retrieval, an incomplete user object must be identifiable, 
    so either the user_id or usernames must be defined.
    For creating a new user, an incomplete user object should contain essential information,
    such as usernames 
    @author: Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetInfo = channel.unary_unary(
                '/avikom.generic.UserService/GetInfo',
                request_serializer=avikom_dot_generic_dot_user__pb2.User.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_user__pb2.User.FromString,
                )
        self.GetProfile = channel.unary_unary(
                '/avikom.generic.UserService/GetProfile',
                request_serializer=avikom_dot_generic_dot_user__pb2.User.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_user__profile__pb2.UserProfile.FromString,
                )
        self.AddUser = channel.unary_unary(
                '/avikom.generic.UserService/AddUser',
                request_serializer=avikom_dot_generic_dot_user__pb2.User.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_user__pb2.User.FromString,
                )


class UserServiceServicer(object):
    """*
    A service to create users and to get additional information about an incomplete user object. 
    For information retrieval, an incomplete user object must be identifiable, 
    so either the user_id or usernames must be defined.
    For creating a new user, an incomplete user object should contain essential information,
    such as usernames 
    @author: Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    def GetInfo(self, request, context):
        """/ expects an incomplete user object (needs to be identifiable) and will return a (hopefully) complete User or the default user (id = 0)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetProfile(self, request, context):
        """/ expects an incomplete user object (needs to be identifiable) and will return the profile of that user or an error (if user not found)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddUser(self, request, context):
        """/ expects an incomplete user object (essential information should be set, user_id should not be set); creates a user and returns the created user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_UserServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetInfo,
                    request_deserializer=avikom_dot_generic_dot_user__pb2.User.FromString,
                    response_serializer=avikom_dot_generic_dot_user__pb2.User.SerializeToString,
            ),
            'GetProfile': grpc.unary_unary_rpc_method_handler(
                    servicer.GetProfile,
                    request_deserializer=avikom_dot_generic_dot_user__pb2.User.FromString,
                    response_serializer=avikom_dot_generic_dot_user__profile__pb2.UserProfile.SerializeToString,
            ),
            'AddUser': grpc.unary_unary_rpc_method_handler(
                    servicer.AddUser,
                    request_deserializer=avikom_dot_generic_dot_user__pb2.User.FromString,
                    response_serializer=avikom_dot_generic_dot_user__pb2.User.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'avikom.generic.UserService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class UserService(object):
    """*
    A service to create users and to get additional information about an incomplete user object. 
    For information retrieval, an incomplete user object must be identifiable, 
    so either the user_id or usernames must be defined.
    For creating a new user, an incomplete user object should contain essential information,
    such as usernames 
    @author: Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    @staticmethod
    def GetInfo(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, '/avikom.generic.UserService/GetInfo',
            avikom_dot_generic_dot_user__pb2.User.SerializeToString,
            avikom_dot_generic_dot_user__pb2.User.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetProfile(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, '/avikom.generic.UserService/GetProfile',
            avikom_dot_generic_dot_user__pb2.User.SerializeToString,
            avikom_dot_generic_dot_user__profile__pb2.UserProfile.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddUser(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, '/avikom.generic.UserService/AddUser',
            avikom_dot_generic_dot_user__pb2.User.SerializeToString,
            avikom_dot_generic_dot_user__pb2.User.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
