# 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 circle_pb2 as iotics_dot_api_dot_circle__pb2


class CircleAPIStub(object):
    """---------------------------------------------------------------------------------------------------------------------

    CircleAPI enables creation and management of Iotics circles.
    Services only affect local resources.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.UpsertCircle = channel.unary_unary(
                '/iotics.api.CircleAPI/UpsertCircle',
                request_serializer=iotics_dot_api_dot_circle__pb2.UpsertCircleRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_circle__pb2.UpsertCircleResponse.FromString,
                _registered_method=True)
        self.DeleteCircle = channel.unary_unary(
                '/iotics.api.CircleAPI/DeleteCircle',
                request_serializer=iotics_dot_api_dot_circle__pb2.DeleteCircleRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_circle__pb2.DeleteCircleResponse.FromString,
                _registered_method=True)
        self.DescribeCircle = channel.unary_unary(
                '/iotics.api.CircleAPI/DescribeCircle',
                request_serializer=iotics_dot_api_dot_circle__pb2.DescribeCircleRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_circle__pb2.DescribeCircleResponse.FromString,
                _registered_method=True)
        self.ListAllCircles = channel.unary_unary(
                '/iotics.api.CircleAPI/ListAllCircles',
                request_serializer=iotics_dot_api_dot_circle__pb2.ListAllCirclesRequest.SerializeToString,
                response_deserializer=iotics_dot_api_dot_circle__pb2.ListAllCirclesResponse.FromString,
                _registered_method=True)


class CircleAPIServicer(object):
    """---------------------------------------------------------------------------------------------------------------------

    CircleAPI enables creation and management of Iotics circles.
    Services only affect local resources.
    """

    def UpsertCircle(self, request, context):
        """UpsertCircle creates or updates a circle with its metadata.
        The full state is applied (ie. if the operation succeeds the state of the circle will
        be the one described in the payload)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteCircle(self, request, context):
        """DeleteCircle deletes a circle.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DescribeCircle(self, request, context):
        """Describes a circle.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListAllCircles(self, request, context):
        """List all circles.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_CircleAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'UpsertCircle': grpc.unary_unary_rpc_method_handler(
                    servicer.UpsertCircle,
                    request_deserializer=iotics_dot_api_dot_circle__pb2.UpsertCircleRequest.FromString,
                    response_serializer=iotics_dot_api_dot_circle__pb2.UpsertCircleResponse.SerializeToString,
            ),
            'DeleteCircle': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteCircle,
                    request_deserializer=iotics_dot_api_dot_circle__pb2.DeleteCircleRequest.FromString,
                    response_serializer=iotics_dot_api_dot_circle__pb2.DeleteCircleResponse.SerializeToString,
            ),
            'DescribeCircle': grpc.unary_unary_rpc_method_handler(
                    servicer.DescribeCircle,
                    request_deserializer=iotics_dot_api_dot_circle__pb2.DescribeCircleRequest.FromString,
                    response_serializer=iotics_dot_api_dot_circle__pb2.DescribeCircleResponse.SerializeToString,
            ),
            'ListAllCircles': grpc.unary_unary_rpc_method_handler(
                    servicer.ListAllCircles,
                    request_deserializer=iotics_dot_api_dot_circle__pb2.ListAllCirclesRequest.FromString,
                    response_serializer=iotics_dot_api_dot_circle__pb2.ListAllCirclesResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'iotics.api.CircleAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('iotics.api.CircleAPI', rpc_method_handlers)


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

    CircleAPI enables creation and management of Iotics circles.
    Services only affect local resources.
    """

    @staticmethod
    def UpsertCircle(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.CircleAPI/UpsertCircle',
            iotics_dot_api_dot_circle__pb2.UpsertCircleRequest.SerializeToString,
            iotics_dot_api_dot_circle__pb2.UpsertCircleResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteCircle(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.CircleAPI/DeleteCircle',
            iotics_dot_api_dot_circle__pb2.DeleteCircleRequest.SerializeToString,
            iotics_dot_api_dot_circle__pb2.DeleteCircleResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DescribeCircle(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.CircleAPI/DescribeCircle',
            iotics_dot_api_dot_circle__pb2.DescribeCircleRequest.SerializeToString,
            iotics_dot_api_dot_circle__pb2.DescribeCircleResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListAllCircles(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.CircleAPI/ListAllCircles',
            iotics_dot_api_dot_circle__pb2.ListAllCirclesRequest.SerializeToString,
            iotics_dot_api_dot_circle__pb2.ListAllCirclesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
