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

from . import actor_pb2 as actor__pb2
from . import aiddl_pb2 as aiddl__pb2


class ActorStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.IsSupported = channel.unary_unary(
                '/org.aiddl.external.grpc.Actor/IsSupported',
                request_serializer=aiddl__pb2.Term.SerializeToString,
                response_deserializer=actor__pb2.Supported.FromString,
                )
        self.Dispatch = channel.unary_unary(
                '/org.aiddl.external.grpc.Actor/Dispatch',
                request_serializer=aiddl__pb2.Term.SerializeToString,
                response_deserializer=actor__pb2.Status.FromString,
                )
        self.GetStatus = channel.unary_unary(
                '/org.aiddl.external.grpc.Actor/GetStatus',
                request_serializer=actor__pb2.Id.SerializeToString,
                response_deserializer=actor__pb2.Status.FromString,
                )
        self.Cancel = channel.unary_unary(
                '/org.aiddl.external.grpc.Actor/Cancel',
                request_serializer=actor__pb2.Id.SerializeToString,
                response_deserializer=actor__pb2.Status.FromString,
                )


class ActorServicer(object):
    """Missing associated documentation comment in .proto file."""

    def IsSupported(self, request, context):
        """Ask actor if an AIDDL string is is considered as a supported action
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Dispatch(self, request, context):
        """Request action. Returns status with Id that can be used to request state updates or cancel execution.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStatus(self, request, context):
        """Get current status of an action based on its id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Cancel(self, request, context):
        """Cancel an action based on its id. Also returns status after cancelation request.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ActorServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'IsSupported': grpc.unary_unary_rpc_method_handler(
                    servicer.IsSupported,
                    request_deserializer=aiddl__pb2.Term.FromString,
                    response_serializer=actor__pb2.Supported.SerializeToString,
            ),
            'Dispatch': grpc.unary_unary_rpc_method_handler(
                    servicer.Dispatch,
                    request_deserializer=aiddl__pb2.Term.FromString,
                    response_serializer=actor__pb2.Status.SerializeToString,
            ),
            'GetStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStatus,
                    request_deserializer=actor__pb2.Id.FromString,
                    response_serializer=actor__pb2.Status.SerializeToString,
            ),
            'Cancel': grpc.unary_unary_rpc_method_handler(
                    servicer.Cancel,
                    request_deserializer=actor__pb2.Id.FromString,
                    response_serializer=actor__pb2.Status.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'org.aiddl.external.grpc.Actor', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Actor(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def IsSupported(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, '/org.aiddl.external.grpc.Actor/IsSupported',
            aiddl__pb2.Term.SerializeToString,
            actor__pb2.Supported.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Dispatch(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, '/org.aiddl.external.grpc.Actor/Dispatch',
            aiddl__pb2.Term.SerializeToString,
            actor__pb2.Status.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetStatus(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, '/org.aiddl.external.grpc.Actor/GetStatus',
            actor__pb2.Id.SerializeToString,
            actor__pb2.Status.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Cancel(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, '/org.aiddl.external.grpc.Actor/Cancel',
            actor__pb2.Id.SerializeToString,
            actor__pb2.Status.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
