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

from iotics.api import interest_pb2 as iotics_dot_api_dot_interest__pb2


class InterestAPIStub(object):
    """---------------------------------------------------------------------------------------------------------------------

    InterestAPI enables creation and management of interests between a twin and a feed or an input.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.FetchInterests = channel.unary_stream(
                '/iotics.api.InterestAPI/FetchInterests',
                request_serializer=iotics_dot_api_dot_interest__pb2.FetchInterestRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_interest__pb2.FetchInterestResponse.FromString,
                _registered_method=True)
        self.FetchLastStored = channel.unary_unary(
                '/iotics.api.InterestAPI/FetchLastStored',
                request_serializer=iotics_dot_api_dot_interest__pb2.FetchLastStoredRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_interest__pb2.FetchInterestResponse.FromString,
                _registered_method=True)
        self.SendInputMessage = channel.unary_unary(
                '/iotics.api.InterestAPI/SendInputMessage',
                request_serializer=iotics_dot_api_dot_interest__pb2.SendInputMessageRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_interest__pb2.SendInputMessageResponse.FromString,
                _registered_method=True)


class InterestAPIServicer(object):
    """---------------------------------------------------------------------------------------------------------------------

    InterestAPI enables creation and management of interests between a twin and a feed or an input.
    """

    def FetchInterests(self, request, context):
        """Fetch feed data for this interest. (local and remote)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FetchLastStored(self, request, context):
        """Fetch last data shared on this interest. (local and remote)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendInputMessage(self, request, context):
        """Send a message to an input. (local and remote)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_InterestAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'FetchInterests': grpc.unary_stream_rpc_method_handler(
                    servicer.FetchInterests,
                    request_deserializer=iotics_dot_api_dot_interest__pb2.FetchInterestRequest.FromString,
                    response_serializer=iotics_dot_api_dot_interest__pb2.FetchInterestResponse.SerializeToString,
            ),
            'FetchLastStored': grpc.unary_unary_rpc_method_handler(
                    servicer.FetchLastStored,
                    request_deserializer=iotics_dot_api_dot_interest__pb2.FetchLastStoredRequest.FromString,
                    response_serializer=iotics_dot_api_dot_interest__pb2.FetchInterestResponse.SerializeToString,
            ),
            'SendInputMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.SendInputMessage,
                    request_deserializer=iotics_dot_api_dot_interest__pb2.SendInputMessageRequest.FromString,
                    response_serializer=iotics_dot_api_dot_interest__pb2.SendInputMessageResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'iotics.api.InterestAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('iotics.api.InterestAPI', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class InterestAPI(object):
    """---------------------------------------------------------------------------------------------------------------------

    InterestAPI enables creation and management of interests between a twin and a feed or an input.
    """

    @staticmethod
    def FetchInterests(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_stream(
            request,
            target,
            '/iotics.api.InterestAPI/FetchInterests',
            iotics_dot_api_dot_interest__pb2.FetchInterestRequest.SerializeToString,
            iotics_dot_api_dot_interest__pb2.FetchInterestResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def FetchLastStored(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,
            '/iotics.api.InterestAPI/FetchLastStored',
            iotics_dot_api_dot_interest__pb2.FetchLastStoredRequest.SerializeToString,
            iotics_dot_api_dot_interest__pb2.FetchInterestResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SendInputMessage(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,
            '/iotics.api.InterestAPI/SendInputMessage',
            iotics_dot_api_dot_interest__pb2.SendInputMessageRequest.SerializeToString,
            iotics_dot_api_dot_interest__pb2.SendInputMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
