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

from avikom.assistance import session_pb2 as avikom_dot_assistance_dot_session__pb2
from avikom.assistance import session_query_pb2 as avikom_dot_assistance_dot_session__query__pb2
from avikom.assistance import session_storage_service_pb2 as avikom_dot_assistance_dot_session__storage__service__pb2
from avikom.generic import result_pb2 as avikom_dot_generic_dot_result__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class SessionStorageServiceStub(object):
    """*
    A service to store, alter and retrieve sessions.
    @author Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SaveSession = channel.unary_unary(
                '/avikom.assistance.SessionStorageService/SaveSession',
                request_serializer=avikom_dot_assistance_dot_session__pb2.Session.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.GetSession = channel.unary_unary(
                '/avikom.assistance.SessionStorageService/GetSession',
                request_serializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
                response_deserializer=avikom_dot_assistance_dot_session__pb2.Session.FromString,
                )
        self.GetAllSessions = channel.unary_unary(
                '/avikom.assistance.SessionStorageService/GetAllSessions',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=avikom_dot_assistance_dot_session__storage__service__pb2.SessionList.FromString,
                )
        self.DeleteSession = channel.unary_unary(
                '/avikom.assistance.SessionStorageService/DeleteSession',
                request_serializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )


class SessionStorageServiceServicer(object):
    """*
    A service to store, alter and retrieve sessions.
    @author Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    def SaveSession(self, request, context):
        """/ stores a sesion; if it exists it will be updated.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetSession(self, request, context):
        """/ retrieves a single session; `SessionQuery` must return a single session
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAllSessions(self, request, context):
        """/ returns all currently stored sessions
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteSession(self, request, context):
        """/ deletes (a) session(s); deletes all sessions that fulfill `SessionQuery`
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SessionStorageServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SaveSession': grpc.unary_unary_rpc_method_handler(
                    servicer.SaveSession,
                    request_deserializer=avikom_dot_assistance_dot_session__pb2.Session.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'GetSession': grpc.unary_unary_rpc_method_handler(
                    servicer.GetSession,
                    request_deserializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.FromString,
                    response_serializer=avikom_dot_assistance_dot_session__pb2.Session.SerializeToString,
            ),
            'GetAllSessions': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAllSessions,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=avikom_dot_assistance_dot_session__storage__service__pb2.SessionList.SerializeToString,
            ),
            'DeleteSession': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteSession,
                    request_deserializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'avikom.assistance.SessionStorageService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class SessionStorageService(object):
    """*
    A service to store, alter and retrieve sessions.
    @author Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    @staticmethod
    def SaveSession(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.assistance.SessionStorageService/SaveSession',
            avikom_dot_assistance_dot_session__pb2.Session.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetSession(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.assistance.SessionStorageService/GetSession',
            avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
            avikom_dot_assistance_dot_session__pb2.Session.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetAllSessions(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.assistance.SessionStorageService/GetAllSessions',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            avikom_dot_assistance_dot_session__storage__service__pb2.SessionList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteSession(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.assistance.SessionStorageService/DeleteSession',
            avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
