# 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 service_provider_service_pb2 as avikom_dot_assistance_dot_service__provider__service__pb2
from avikom.generic import result_pb2 as avikom_dot_generic_dot_result__pb2


class ServiceProviderServiceStub(object):
    """*
    A service is a task step-agnostic solution provider.
    It must be specifically requested/configured in the apprpriate task step.
    @author Alexander McService Neumann <alneuman@techfak.uni-bielefeld.de>
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.PostServiceRequest = channel.unary_unary(
                '/avikom.assistance.ServiceProviderService/PostServiceRequest',
                request_serializer=avikom_dot_assistance_dot_service__provider__service__pb2.ServiceRequest.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )
        self.CancelServiceRequest = channel.unary_unary(
                '/avikom.assistance.ServiceProviderService/CancelServiceRequest',
                request_serializer=avikom_dot_assistance_dot_service__provider__service__pb2.ServiceRequest.SerializeToString,
                response_deserializer=avikom_dot_generic_dot_result__pb2.Result.FromString,
                )


class ServiceProviderServiceServicer(object):
    """*
    A service is a task step-agnostic solution provider.
    It must be specifically requested/configured in the apprpriate task step.
    @author Alexander McService Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    def PostServiceRequest(self, request, context):
        """/ starts the service; a task_id must be passed for the service to resolve it
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelServiceRequest(self, request, context):
        """/ cancels a currently running task request; task_id must be provided
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ServiceProviderServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'PostServiceRequest': grpc.unary_unary_rpc_method_handler(
                    servicer.PostServiceRequest,
                    request_deserializer=avikom_dot_assistance_dot_service__provider__service__pb2.ServiceRequest.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
            'CancelServiceRequest': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelServiceRequest,
                    request_deserializer=avikom_dot_assistance_dot_service__provider__service__pb2.ServiceRequest.FromString,
                    response_serializer=avikom_dot_generic_dot_result__pb2.Result.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'avikom.assistance.ServiceProviderService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ServiceProviderService(object):
    """*
    A service is a task step-agnostic solution provider.
    It must be specifically requested/configured in the apprpriate task step.
    @author Alexander McService Neumann <alneuman@techfak.uni-bielefeld.de>
    """

    @staticmethod
    def PostServiceRequest(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.ServiceProviderService/PostServiceRequest',
            avikom_dot_assistance_dot_service__provider__service__pb2.ServiceRequest.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CancelServiceRequest(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.ServiceProviderService/CancelServiceRequest',
            avikom_dot_assistance_dot_service__provider__service__pb2.ServiceRequest.SerializeToString,
            avikom_dot_generic_dot_result__pb2.Result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
