# 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 runtime_step_list_pb2 as avikom_dot_assistance_dot_runtime__step__list__pb2
from avikom.assistance import session_query_pb2 as avikom_dot_assistance_dot_session__query__pb2
from avikom.assistance import session_service_pb2 as avikom_dot_assistance_dot_session__service__pb2
from avikom.generic import peer_pb2 as avikom_dot_generic_dot_peer__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 SessionServiceStub(object):
    """
    This service initializes sessions and starts the related Camunda processes.
    It also processes TaskStep completion and failure events and forwards these information to Camunda.
    Furthermore it processes environmental factors that may influence a session and can be used to request currently eligible `RuntimeTaskSteps`.
    @author Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.EmitEvent = channel.unary_unary(
                '/avikom.assistance.SessionService/EmitEvent',
                request_serializer=avikom_dot_assistance_dot_session__service__pb2.SessionEvent.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.CompleteTaskStep = channel.unary_unary(
                '/avikom.assistance.SessionService/CompleteTaskStep',
                request_serializer=avikom_dot_assistance_dot_session__service__pb2.TaskEvent.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.FailTaskStep = channel.unary_unary(
                '/avikom.assistance.SessionService/FailTaskStep',
                request_serializer=avikom_dot_assistance_dot_session__service__pb2.TaskEvent.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.GetCurrentStep = channel.unary_unary(
                '/avikom.assistance.SessionService/GetCurrentStep',
                request_serializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
                response_deserializer=avikom_dot_assistance_dot_runtime__step__list__pb2.RuntimeStepList.FromString,
                )
        self.StartSession = channel.unary_unary(
                '/avikom.assistance.SessionService/StartSession',
                request_serializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.SuspendSession = channel.unary_unary(
                '/avikom.assistance.SessionService/SuspendSession',
                request_serializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.EndSession = channel.unary_unary(
                '/avikom.assistance.SessionService/EndSession',
                request_serializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.UpdateEnvironmentalFactors = channel.unary_unary(
                '/avikom.assistance.SessionService/UpdateEnvironmentalFactors',
                request_serializer=avikom_dot_assistance_dot_session__service__pb2.EnvironmentalFactorsUpdate.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.RegisterUserPeer = channel.unary_unary(
                '/avikom.assistance.SessionService/RegisterUserPeer',
                request_serializer=avikom_dot_generic_dot_peer__pb2.Peer.SerializeToString,
                response_deserializer=avikom_dot_assistance_dot_runtime__step__list__pb2.RuntimeStepList.FromString,
                )
        self.EndAllProcesses = channel.unary_unary(
                '/avikom.assistance.SessionService/EndAllProcesses',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )


class SessionServiceServicer(object):
    """
    This service initializes sessions and starts the related Camunda processes.
    It also processes TaskStep completion and failure events and forwards these information to Camunda.
    Furthermore it processes environmental factors that may influence a session and can be used to request currently eligible `RuntimeTaskSteps`.
    @author Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    def EmitEvent(self, request, context):
        """/ pushes an event to Camunda for processing
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CompleteTaskStep(self, request, context):
        """/ completes an event; `task_id` is required; `result` will be forwarded to the related service worker if provided.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FailTaskStep(self, request, context):
        """/ fails an event; `task_id` is required; This will most likely lead to Camunda advertising the related `TaskStep` again or process failure if the maximum amount of retries has been reached.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetCurrentStep(self, request, context):
        """/ returns the currently eligible `RunTimeTaskSteps` assigned to a session
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StartSession(self, request, context):
        """/ starts a session; a mean to identify the user (e.g. `user_id` or `username`) must be provided
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SuspendSession(self, request, context):
        """/ suspends a session; it can be continued later on; can be queried with `session_id` or means to identify the user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def EndSession(self, request, context):
        """/ removes the session from the system; can be queried with `session_id` or means to identify the user
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateEnvironmentalFactors(self, request, context):
        """/ updates `brightness` and/or `volume` (loudness) of a session; with only a scene name passed, all related sessions should be updated
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RegisterUserPeer(self, request, context):
        """/ Registers or updates a peer of a user for a running session. The new peer receives the currently processed and orchestrated RuntimeStepList.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def EndAllProcesses(self, request, context):
        """/ Ends all sessions and all Camunda processes
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SessionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'EmitEvent': grpc.unary_unary_rpc_method_handler(
                    servicer.EmitEvent,
                    request_deserializer=avikom_dot_assistance_dot_session__service__pb2.SessionEvent.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'CompleteTaskStep': grpc.unary_unary_rpc_method_handler(
                    servicer.CompleteTaskStep,
                    request_deserializer=avikom_dot_assistance_dot_session__service__pb2.TaskEvent.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'FailTaskStep': grpc.unary_unary_rpc_method_handler(
                    servicer.FailTaskStep,
                    request_deserializer=avikom_dot_assistance_dot_session__service__pb2.TaskEvent.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'GetCurrentStep': grpc.unary_unary_rpc_method_handler(
                    servicer.GetCurrentStep,
                    request_deserializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.FromString,
                    response_serializer=avikom_dot_assistance_dot_runtime__step__list__pb2.RuntimeStepList.SerializeToString,
            ),
            'StartSession': grpc.unary_unary_rpc_method_handler(
                    servicer.StartSession,
                    request_deserializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'SuspendSession': grpc.unary_unary_rpc_method_handler(
                    servicer.SuspendSession,
                    request_deserializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'EndSession': grpc.unary_unary_rpc_method_handler(
                    servicer.EndSession,
                    request_deserializer=avikom_dot_assistance_dot_session__query__pb2.SessionQuery.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'UpdateEnvironmentalFactors': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateEnvironmentalFactors,
                    request_deserializer=avikom_dot_assistance_dot_session__service__pb2.EnvironmentalFactorsUpdate.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'RegisterUserPeer': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterUserPeer,
                    request_deserializer=avikom_dot_generic_dot_peer__pb2.Peer.FromString,
                    response_serializer=avikom_dot_assistance_dot_runtime__step__list__pb2.RuntimeStepList.SerializeToString,
            ),
            'EndAllProcesses': grpc.unary_unary_rpc_method_handler(
                    servicer.EndAllProcesses,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'avikom.assistance.SessionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class SessionService(object):
    """
    This service initializes sessions and starts the related Camunda processes.
    It also processes TaskStep completion and failure events and forwards these information to Camunda.
    Furthermore it processes environmental factors that may influence a session and can be used to request currently eligible `RuntimeTaskSteps`.
    @author Alexander Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    @staticmethod
    def EmitEvent(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.SessionService/EmitEvent',
            avikom_dot_assistance_dot_session__service__pb2.SessionEvent.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CompleteTaskStep(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.SessionService/CompleteTaskStep',
            avikom_dot_assistance_dot_session__service__pb2.TaskEvent.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def FailTaskStep(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.SessionService/FailTaskStep',
            avikom_dot_assistance_dot_session__service__pb2.TaskEvent.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetCurrentStep(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.SessionService/GetCurrentStep',
            avikom_dot_assistance_dot_session__query__pb2.SessionQuery.SerializeToString,
            avikom_dot_assistance_dot_runtime__step__list__pb2.RuntimeStepList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StartSession(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.SessionService/StartSession',
            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)

    @staticmethod
    def SuspendSession(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.SessionService/SuspendSession',
            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)

    @staticmethod
    def EndSession(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.SessionService/EndSession',
            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)

    @staticmethod
    def UpdateEnvironmentalFactors(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.SessionService/UpdateEnvironmentalFactors',
            avikom_dot_assistance_dot_session__service__pb2.EnvironmentalFactorsUpdate.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RegisterUserPeer(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.SessionService/RegisterUserPeer',
            avikom_dot_generic_dot_peer__pb2.Peer.SerializeToString,
            avikom_dot_assistance_dot_runtime__step__list__pb2.RuntimeStepList.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def EndAllProcesses(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.SessionService/EndAllProcesses',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
