# -*- coding: utf-8 -*-
# noqa: D100, D101, D102, D103, D104, D107, D400, D415
# ruff: noqa
# type: ignore
# pylint: skip-file
# Generated by protoc - do not edit
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
# Standard

# Third-Party
import grpc

# First-Party
from mcpgateway.plugins.framework.external.grpc.proto import plugin_service_pb2 as plugin__service__pb2

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

try:
    # Third-Party
    from grpc._utilities import first_version_is_lower

    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:  # pragma: no cover
    _version_not_supported = True

if _version_not_supported:  # pragma: no cover
    raise RuntimeError(
        f"The grpc package installed is at version {GRPC_VERSION},"
        + " but the generated code in plugin_service_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):
    """============================================================================
    Plugin Service - Main service for external plugin communication
    ============================================================================

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetPluginConfig = channel.unary_unary(
            "/mcpgateway.plugins.PluginService/GetPluginConfig",
            request_serializer=plugin__service__pb2.GetPluginConfigRequest.SerializeToString,
            response_deserializer=plugin__service__pb2.GetPluginConfigResponse.FromString,
            _registered_method=True,
        )
        self.GetPluginConfigs = channel.unary_unary(
            "/mcpgateway.plugins.PluginService/GetPluginConfigs",
            request_serializer=plugin__service__pb2.GetPluginConfigsRequest.SerializeToString,
            response_deserializer=plugin__service__pb2.GetPluginConfigsResponse.FromString,
            _registered_method=True,
        )
        self.InvokeHook = channel.unary_unary(
            "/mcpgateway.plugins.PluginService/InvokeHook",
            request_serializer=plugin__service__pb2.InvokeHookRequest.SerializeToString,
            response_deserializer=plugin__service__pb2.InvokeHookResponse.FromString,
            _registered_method=True,
        )


class PluginServiceServicer(object):
    """============================================================================
    Plugin Service - Main service for external plugin communication
    ============================================================================

    """

    def GetPluginConfig(self, request, context):
        """Get configuration for a single plugin by name"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetPluginConfigs(self, request, context):
        """Get configurations for all plugins on the server"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def InvokeHook(self, request, context):
        """Invoke a plugin hook"""
        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 = {
        "GetPluginConfig": grpc.unary_unary_rpc_method_handler(
            servicer.GetPluginConfig,
            request_deserializer=plugin__service__pb2.GetPluginConfigRequest.FromString,
            response_serializer=plugin__service__pb2.GetPluginConfigResponse.SerializeToString,
        ),
        "GetPluginConfigs": grpc.unary_unary_rpc_method_handler(
            servicer.GetPluginConfigs,
            request_deserializer=plugin__service__pb2.GetPluginConfigsRequest.FromString,
            response_serializer=plugin__service__pb2.GetPluginConfigsResponse.SerializeToString,
        ),
        "InvokeHook": grpc.unary_unary_rpc_method_handler(
            servicer.InvokeHook,
            request_deserializer=plugin__service__pb2.InvokeHookRequest.FromString,
            response_serializer=plugin__service__pb2.InvokeHookResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("mcpgateway.plugins.PluginService", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("mcpgateway.plugins.PluginService", rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class PluginService(object):
    """============================================================================
    Plugin Service - Main service for external plugin communication
    ============================================================================

    """

    @staticmethod
    def GetPluginConfig(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,
            "/mcpgateway.plugins.PluginService/GetPluginConfig",
            plugin__service__pb2.GetPluginConfigRequest.SerializeToString,
            plugin__service__pb2.GetPluginConfigResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def GetPluginConfigs(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,
            "/mcpgateway.plugins.PluginService/GetPluginConfigs",
            plugin__service__pb2.GetPluginConfigsRequest.SerializeToString,
            plugin__service__pb2.GetPluginConfigsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def InvokeHook(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,
            "/mcpgateway.plugins.PluginService/InvokeHook",
            plugin__service__pb2.InvokeHookRequest.SerializeToString,
            plugin__service__pb2.InvokeHookResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )


class HealthStub(object):
    """============================================================================
    Health Service - Standard gRPC health checking
    ============================================================================

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Check = channel.unary_unary(
            "/mcpgateway.plugins.Health/Check",
            request_serializer=plugin__service__pb2.HealthCheckRequest.SerializeToString,
            response_deserializer=plugin__service__pb2.HealthCheckResponse.FromString,
            _registered_method=True,
        )


class HealthServicer(object):
    """============================================================================
    Health Service - Standard gRPC health checking
    ============================================================================

    """

    def Check(self, request, context):
        """Check the health status of the plugin server"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_HealthServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Check": grpc.unary_unary_rpc_method_handler(
            servicer.Check,
            request_deserializer=plugin__service__pb2.HealthCheckRequest.FromString,
            response_serializer=plugin__service__pb2.HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler("mcpgateway.plugins.Health", rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers("mcpgateway.plugins.Health", rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class Health(object):
    """============================================================================
    Health Service - Standard gRPC health checking
    ============================================================================

    """

    @staticmethod
    def Check(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,
            "/mcpgateway.plugins.Health/Check",
            plugin__service__pb2.HealthCheckRequest.SerializeToString,
            plugin__service__pb2.HealthCheckResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
