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

from . import rule_installation_pb2 as rule__installation__pb2

GRPC_GENERATED_VERSION = '1.76.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in rule_installation_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class DataPlaneStub(object):
    """Service for installing rules and enforcing intents
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.InstallRules = channel.unary_unary(
                '/rule_installation.DataPlane/InstallRules',
                request_serializer=rule__installation__pb2.InstallRulesRequest.SerializeToString,
                response_deserializer=rule__installation__pb2.InstallRulesResponse.FromString,
                _registered_method=True)
        self.RemoveAgentRules = channel.unary_unary(
                '/rule_installation.DataPlane/RemoveAgentRules',
                request_serializer=rule__installation__pb2.RemoveAgentRulesRequest.SerializeToString,
                response_deserializer=rule__installation__pb2.RemoveAgentRulesResponse.FromString,
                _registered_method=True)
        self.GetRuleStats = channel.unary_unary(
                '/rule_installation.DataPlane/GetRuleStats',
                request_serializer=rule__installation__pb2.GetRuleStatsRequest.SerializeToString,
                response_deserializer=rule__installation__pb2.GetRuleStatsResponse.FromString,
                _registered_method=True)
        self.Enforce = channel.unary_unary(
                '/rule_installation.DataPlane/Enforce',
                request_serializer=rule__installation__pb2.EnforceRequest.SerializeToString,
                response_deserializer=rule__installation__pb2.EnforceResponse.FromString,
                _registered_method=True)
        self.QueryTelemetry = channel.unary_unary(
                '/rule_installation.DataPlane/QueryTelemetry',
                request_serializer=rule__installation__pb2.QueryTelemetryRequest.SerializeToString,
                response_deserializer=rule__installation__pb2.QueryTelemetryResponse.FromString,
                _registered_method=True)
        self.GetSession = channel.unary_unary(
                '/rule_installation.DataPlane/GetSession',
                request_serializer=rule__installation__pb2.GetSessionRequest.SerializeToString,
                response_deserializer=rule__installation__pb2.GetSessionResponse.FromString,
                _registered_method=True)


class DataPlaneServicer(object):
    """Service for installing rules and enforcing intents
    """

    def InstallRules(self, request, context):
        """Install a batch of rules for an agent
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RemoveAgentRules(self, request, context):
        """Remove rules for an agent
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRuleStats(self, request, context):
        """Get current rule statistics
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Enforce(self, request, context):
        """Enforce rules against an IntentEvent (v1.3)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def QueryTelemetry(self, request, context):
        """Query telemetry sessions from hitlogs
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetSession(self, request, context):
        """Get full details for a specific session
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DataPlaneServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'InstallRules': grpc.unary_unary_rpc_method_handler(
                    servicer.InstallRules,
                    request_deserializer=rule__installation__pb2.InstallRulesRequest.FromString,
                    response_serializer=rule__installation__pb2.InstallRulesResponse.SerializeToString,
            ),
            'RemoveAgentRules': grpc.unary_unary_rpc_method_handler(
                    servicer.RemoveAgentRules,
                    request_deserializer=rule__installation__pb2.RemoveAgentRulesRequest.FromString,
                    response_serializer=rule__installation__pb2.RemoveAgentRulesResponse.SerializeToString,
            ),
            'GetRuleStats': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRuleStats,
                    request_deserializer=rule__installation__pb2.GetRuleStatsRequest.FromString,
                    response_serializer=rule__installation__pb2.GetRuleStatsResponse.SerializeToString,
            ),
            'Enforce': grpc.unary_unary_rpc_method_handler(
                    servicer.Enforce,
                    request_deserializer=rule__installation__pb2.EnforceRequest.FromString,
                    response_serializer=rule__installation__pb2.EnforceResponse.SerializeToString,
            ),
            'QueryTelemetry': grpc.unary_unary_rpc_method_handler(
                    servicer.QueryTelemetry,
                    request_deserializer=rule__installation__pb2.QueryTelemetryRequest.FromString,
                    response_serializer=rule__installation__pb2.QueryTelemetryResponse.SerializeToString,
            ),
            'GetSession': grpc.unary_unary_rpc_method_handler(
                    servicer.GetSession,
                    request_deserializer=rule__installation__pb2.GetSessionRequest.FromString,
                    response_serializer=rule__installation__pb2.GetSessionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'rule_installation.DataPlane', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('rule_installation.DataPlane', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class DataPlane(object):
    """Service for installing rules and enforcing intents
    """

    @staticmethod
    def InstallRules(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,
            '/rule_installation.DataPlane/InstallRules',
            rule__installation__pb2.InstallRulesRequest.SerializeToString,
            rule__installation__pb2.InstallRulesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RemoveAgentRules(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,
            '/rule_installation.DataPlane/RemoveAgentRules',
            rule__installation__pb2.RemoveAgentRulesRequest.SerializeToString,
            rule__installation__pb2.RemoveAgentRulesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetRuleStats(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,
            '/rule_installation.DataPlane/GetRuleStats',
            rule__installation__pb2.GetRuleStatsRequest.SerializeToString,
            rule__installation__pb2.GetRuleStatsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Enforce(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,
            '/rule_installation.DataPlane/Enforce',
            rule__installation__pb2.EnforceRequest.SerializeToString,
            rule__installation__pb2.EnforceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def QueryTelemetry(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,
            '/rule_installation.DataPlane/QueryTelemetry',
            rule__installation__pb2.QueryTelemetryRequest.SerializeToString,
            rule__installation__pb2.QueryTelemetryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetSession(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,
            '/rule_installation.DataPlane/GetSession',
            rule__installation__pb2.GetSessionRequest.SerializeToString,
            rule__installation__pb2.GetSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
