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

from policy import policy_sync_pb2 as policy_dot_policy__sync__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.PolicySyncApply = channel.unary_stream(
                '/ocf.policy.rdbms.RdbmsPolicySync/PolicySyncApply',
                request_serializer=policy_dot_policy__sync__pb2.PolicySyncRequest.SerializeToString,
                response_deserializer=policy_dot_policy__sync__pb2.PolicySyncResponse.FromString,
                )
        self.PolicySyncRevoke = channel.unary_stream(
                '/ocf.policy.rdbms.RdbmsPolicySync/PolicySyncRevoke',
                request_serializer=policy_dot_policy__sync__pb2.PolicySyncRequest.SerializeToString,
                response_deserializer=policy_dot_policy__sync__pb2.PolicySyncResponse.FromString,
                )


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

    def PolicySyncApply(self, request, context):
        """Apply a policy to a list of objects.
        The response is the list of links that were created
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PolicySyncRevoke(self, request, context):
        """Revoke a policy from a list of objects.
        The response is the list of links that were deleted
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_RdbmsPolicySyncServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'PolicySyncApply': grpc.unary_stream_rpc_method_handler(
                    servicer.PolicySyncApply,
                    request_deserializer=policy_dot_policy__sync__pb2.PolicySyncRequest.FromString,
                    response_serializer=policy_dot_policy__sync__pb2.PolicySyncResponse.SerializeToString,
            ),
            'PolicySyncRevoke': grpc.unary_stream_rpc_method_handler(
                    servicer.PolicySyncRevoke,
                    request_deserializer=policy_dot_policy__sync__pb2.PolicySyncRequest.FromString,
                    response_serializer=policy_dot_policy__sync__pb2.PolicySyncResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ocf.policy.rdbms.RdbmsPolicySync', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def PolicySyncApply(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, '/ocf.policy.rdbms.RdbmsPolicySync/PolicySyncApply',
            policy_dot_policy__sync__pb2.PolicySyncRequest.SerializeToString,
            policy_dot_policy__sync__pb2.PolicySyncResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def PolicySyncRevoke(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, '/ocf.policy.rdbms.RdbmsPolicySync/PolicySyncRevoke',
            policy_dot_policy__sync__pb2.PolicySyncRequest.SerializeToString,
            policy_dot_policy__sync__pb2.PolicySyncResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
