# 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 feed_pb2 as iotics_dot_api_dot_feed__pb2


class FeedAPIStub(object):
    """---------------------------------------------------------------------------------------------------------------------

    Create a feed owned by the provided twin.
    A twin may have one or more feeds. Any twin can subscribe to a feed (access control permitting).
    A feed generates data in a 1-to-many relationship: one feed may produce data that is used by many consumers (twins).
    Services only affect local resources, unless stated otherwise.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateFeed = channel.unary_unary(
                '/iotics.api.FeedAPI/CreateFeed',
                request_serializer=iotics_dot_api_dot_feed__pb2.CreateFeedRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_feed__pb2.CreateFeedResponse.FromString,
                _registered_method=True)
        self.DeleteFeed = channel.unary_unary(
                '/iotics.api.FeedAPI/DeleteFeed',
                request_serializer=iotics_dot_api_dot_feed__pb2.DeleteFeedRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_feed__pb2.DeleteFeedResponse.FromString,
                _registered_method=True)
        self.UpdateFeed = channel.unary_unary(
                '/iotics.api.FeedAPI/UpdateFeed',
                request_serializer=iotics_dot_api_dot_feed__pb2.UpdateFeedRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_feed__pb2.UpdateFeedResponse.FromString,
                _registered_method=True)
        self.ShareFeedData = channel.unary_unary(
                '/iotics.api.FeedAPI/ShareFeedData',
                request_serializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataResponse.FromString,
                _registered_method=True)
        self.StreamFeedData = channel.stream_unary(
                '/iotics.api.FeedAPI/StreamFeedData',
                request_serializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataResponse.FromString,
                _registered_method=True)
        self.ListAllFeeds = channel.unary_unary(
                '/iotics.api.FeedAPI/ListAllFeeds',
                request_serializer=iotics_dot_api_dot_feed__pb2.ListAllFeedsRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_feed__pb2.ListAllFeedsResponse.FromString,
                _registered_method=True)
        self.DescribeFeed = channel.unary_unary(
                '/iotics.api.FeedAPI/DescribeFeed',
                request_serializer=iotics_dot_api_dot_feed__pb2.DescribeFeedRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_feed__pb2.DescribeFeedResponse.FromString,
                _registered_method=True)


class FeedAPIServicer(object):
    """---------------------------------------------------------------------------------------------------------------------

    Create a feed owned by the provided twin.
    A twin may have one or more feeds. Any twin can subscribe to a feed (access control permitting).
    A feed generates data in a 1-to-many relationship: one feed may produce data that is used by many consumers (twins).
    Services only affect local resources, unless stated otherwise.
    """

    def CreateFeed(self, request, context):
        """Creates a feed owned by a twin. (Idempotent)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteFeed(self, request, context):
        """Deletes a feed owned by a twin. (Idempotent)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateFeed(self, request, context):
        """Updates attributes of a feed, including its metadata.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ShareFeedData(self, request, context):
        """Shares a new sample of data for the given feed which any (interest) subscribers can receive.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamFeedData(self, request_iterator, context):
        """Shares feed data over a stream, any sharing error will return the error and close the stream.
        Note: cannot share to different feeds over the same stream.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListAllFeeds(self, request, context):
        """Lists all feeds owned by a twin.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DescribeFeed(self, request, context):
        """Describes a feed. (local and remote)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_FeedAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateFeed': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateFeed,
                    request_deserializer=iotics_dot_api_dot_feed__pb2.CreateFeedRequest.FromString,
                    response_serializer=iotics_dot_api_dot_feed__pb2.CreateFeedResponse.SerializeToString,
            ),
            'DeleteFeed': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteFeed,
                    request_deserializer=iotics_dot_api_dot_feed__pb2.DeleteFeedRequest.FromString,
                    response_serializer=iotics_dot_api_dot_feed__pb2.DeleteFeedResponse.SerializeToString,
            ),
            'UpdateFeed': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateFeed,
                    request_deserializer=iotics_dot_api_dot_feed__pb2.UpdateFeedRequest.FromString,
                    response_serializer=iotics_dot_api_dot_feed__pb2.UpdateFeedResponse.SerializeToString,
            ),
            'ShareFeedData': grpc.unary_unary_rpc_method_handler(
                    servicer.ShareFeedData,
                    request_deserializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataRequest.FromString,
                    response_serializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataResponse.SerializeToString,
            ),
            'StreamFeedData': grpc.stream_unary_rpc_method_handler(
                    servicer.StreamFeedData,
                    request_deserializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataRequest.FromString,
                    response_serializer=iotics_dot_api_dot_feed__pb2.ShareFeedDataResponse.SerializeToString,
            ),
            'ListAllFeeds': grpc.unary_unary_rpc_method_handler(
                    servicer.ListAllFeeds,
                    request_deserializer=iotics_dot_api_dot_feed__pb2.ListAllFeedsRequest.FromString,
                    response_serializer=iotics_dot_api_dot_feed__pb2.ListAllFeedsResponse.SerializeToString,
            ),
            'DescribeFeed': grpc.unary_unary_rpc_method_handler(
                    servicer.DescribeFeed,
                    request_deserializer=iotics_dot_api_dot_feed__pb2.DescribeFeedRequest.FromString,
                    response_serializer=iotics_dot_api_dot_feed__pb2.DescribeFeedResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'iotics.api.FeedAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('iotics.api.FeedAPI', rpc_method_handlers)


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

    Create a feed owned by the provided twin.
    A twin may have one or more feeds. Any twin can subscribe to a feed (access control permitting).
    A feed generates data in a 1-to-many relationship: one feed may produce data that is used by many consumers (twins).
    Services only affect local resources, unless stated otherwise.
    """

    @staticmethod
    def CreateFeed(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.FeedAPI/CreateFeed',
            iotics_dot_api_dot_feed__pb2.CreateFeedRequest.SerializeToString,
            iotics_dot_api_dot_feed__pb2.CreateFeedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteFeed(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.FeedAPI/DeleteFeed',
            iotics_dot_api_dot_feed__pb2.DeleteFeedRequest.SerializeToString,
            iotics_dot_api_dot_feed__pb2.DeleteFeedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateFeed(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.FeedAPI/UpdateFeed',
            iotics_dot_api_dot_feed__pb2.UpdateFeedRequest.SerializeToString,
            iotics_dot_api_dot_feed__pb2.UpdateFeedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ShareFeedData(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.FeedAPI/ShareFeedData',
            iotics_dot_api_dot_feed__pb2.ShareFeedDataRequest.SerializeToString,
            iotics_dot_api_dot_feed__pb2.ShareFeedDataResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamFeedData(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/iotics.api.FeedAPI/StreamFeedData',
            iotics_dot_api_dot_feed__pb2.ShareFeedDataRequest.SerializeToString,
            iotics_dot_api_dot_feed__pb2.ShareFeedDataResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListAllFeeds(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.FeedAPI/ListAllFeeds',
            iotics_dot_api_dot_feed__pb2.ListAllFeedsRequest.SerializeToString,
            iotics_dot_api_dot_feed__pb2.ListAllFeedsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DescribeFeed(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.FeedAPI/DescribeFeed',
            iotics_dot_api_dot_feed__pb2.DescribeFeedRequest.SerializeToString,
            iotics_dot_api_dot_feed__pb2.DescribeFeedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
