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

import plugin_pb2 as plugin__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 plugin_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 PluginServiceStub(object):
    """PluginService - Every plugin implements this service
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetManifest = channel.unary_unary(
                '/app4.plugin.PluginService/GetManifest',
                request_serializer=plugin__pb2.Empty.SerializeToString,
                response_deserializer=plugin__pb2.Manifest.FromString,
                _registered_method=True)
        self.ExecuteAction = channel.unary_unary(
                '/app4.plugin.PluginService/ExecuteAction',
                request_serializer=plugin__pb2.ActionRequest.SerializeToString,
                response_deserializer=plugin__pb2.ActionResponse.FromString,
                _registered_method=True)
        self.ListActions = channel.unary_unary(
                '/app4.plugin.PluginService/ListActions',
                request_serializer=plugin__pb2.Empty.SerializeToString,
                response_deserializer=plugin__pb2.ActionList.FromString,
                _registered_method=True)
        self.InitProvider = channel.unary_unary(
                '/app4.plugin.PluginService/InitProvider',
                request_serializer=plugin__pb2.ProviderConfig.SerializeToString,
                response_deserializer=plugin__pb2.ProviderResponse.FromString,
                _registered_method=True)
        self.CloseProvider = channel.unary_unary(
                '/app4.plugin.PluginService/CloseProvider',
                request_serializer=plugin__pb2.ProviderName.SerializeToString,
                response_deserializer=plugin__pb2.ProviderResponse.FromString,
                _registered_method=True)
        self.Health = channel.unary_unary(
                '/app4.plugin.PluginService/Health',
                request_serializer=plugin__pb2.Empty.SerializeToString,
                response_deserializer=plugin__pb2.HealthResponse.FromString,
                _registered_method=True)
        self.Shutdown = channel.unary_unary(
                '/app4.plugin.PluginService/Shutdown',
                request_serializer=plugin__pb2.Empty.SerializeToString,
                response_deserializer=plugin__pb2.Empty.FromString,
                _registered_method=True)
        self.GetStatus = channel.unary_unary(
                '/app4.plugin.PluginService/GetStatus',
                request_serializer=plugin__pb2.Empty.SerializeToString,
                response_deserializer=plugin__pb2.PluginStatus.FromString,
                _registered_method=True)


class PluginServiceServicer(object):
    """PluginService - Every plugin implements this service
    """

    def GetManifest(self, request, context):
        """Plugin identity and capabilities
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecuteAction(self, request, context):
        """Action execution
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListActions(self, request, context):
        """List all actions provided by this plugin
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def InitProvider(self, request, context):
        """Provider lifecycle
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CloseProvider(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Health(self, request, context):
        """Health check
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Shutdown(self, request, context):
        """Graceful shutdown
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStatus(self, request, context):
        """Detailed plugin status (resources, stats, uptime)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PluginServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetManifest': grpc.unary_unary_rpc_method_handler(
                    servicer.GetManifest,
                    request_deserializer=plugin__pb2.Empty.FromString,
                    response_serializer=plugin__pb2.Manifest.SerializeToString,
            ),
            'ExecuteAction': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecuteAction,
                    request_deserializer=plugin__pb2.ActionRequest.FromString,
                    response_serializer=plugin__pb2.ActionResponse.SerializeToString,
            ),
            'ListActions': grpc.unary_unary_rpc_method_handler(
                    servicer.ListActions,
                    request_deserializer=plugin__pb2.Empty.FromString,
                    response_serializer=plugin__pb2.ActionList.SerializeToString,
            ),
            'InitProvider': grpc.unary_unary_rpc_method_handler(
                    servicer.InitProvider,
                    request_deserializer=plugin__pb2.ProviderConfig.FromString,
                    response_serializer=plugin__pb2.ProviderResponse.SerializeToString,
            ),
            'CloseProvider': grpc.unary_unary_rpc_method_handler(
                    servicer.CloseProvider,
                    request_deserializer=plugin__pb2.ProviderName.FromString,
                    response_serializer=plugin__pb2.ProviderResponse.SerializeToString,
            ),
            'Health': grpc.unary_unary_rpc_method_handler(
                    servicer.Health,
                    request_deserializer=plugin__pb2.Empty.FromString,
                    response_serializer=plugin__pb2.HealthResponse.SerializeToString,
            ),
            'Shutdown': grpc.unary_unary_rpc_method_handler(
                    servicer.Shutdown,
                    request_deserializer=plugin__pb2.Empty.FromString,
                    response_serializer=plugin__pb2.Empty.SerializeToString,
            ),
            'GetStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStatus,
                    request_deserializer=plugin__pb2.Empty.FromString,
                    response_serializer=plugin__pb2.PluginStatus.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'app4.plugin.PluginService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('app4.plugin.PluginService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class PluginService(object):
    """PluginService - Every plugin implements this service
    """

    @staticmethod
    def GetManifest(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,
            '/app4.plugin.PluginService/GetManifest',
            plugin__pb2.Empty.SerializeToString,
            plugin__pb2.Manifest.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecuteAction(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,
            '/app4.plugin.PluginService/ExecuteAction',
            plugin__pb2.ActionRequest.SerializeToString,
            plugin__pb2.ActionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListActions(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,
            '/app4.plugin.PluginService/ListActions',
            plugin__pb2.Empty.SerializeToString,
            plugin__pb2.ActionList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def InitProvider(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,
            '/app4.plugin.PluginService/InitProvider',
            plugin__pb2.ProviderConfig.SerializeToString,
            plugin__pb2.ProviderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CloseProvider(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,
            '/app4.plugin.PluginService/CloseProvider',
            plugin__pb2.ProviderName.SerializeToString,
            plugin__pb2.ProviderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Health(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,
            '/app4.plugin.PluginService/Health',
            plugin__pb2.Empty.SerializeToString,
            plugin__pb2.HealthResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Shutdown(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,
            '/app4.plugin.PluginService/Shutdown',
            plugin__pb2.Empty.SerializeToString,
            plugin__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetStatus(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,
            '/app4.plugin.PluginService/GetStatus',
            plugin__pb2.Empty.SerializeToString,
            plugin__pb2.PluginStatus.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
