# 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 algservice.services.grpc import alg_service_pb2 as algservice_dot_services_dot_grpc_dot_alg__service__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2

GRPC_GENERATED_VERSION = '1.64.1'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_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:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in algservice/services/grpc/alg_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}.'
        + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
        + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
        RuntimeWarning
    )


class AlgServiceStub(object):
    """Interface exported by the server.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetVersion = channel.unary_unary(
                '/service.grpc.AlgService/GetVersion',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.ServiceVersion_.FromString,
                _registered_method=True)
        self.GetAlgorithms = channel.unary_unary(
                '/service.grpc.AlgService/GetAlgorithms',
                request_serializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.AlgorithmsRequest_.SerializeToString,
                response_deserializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.AlgorithmsResponse_.FromString,
                _registered_method=True)
        self.Preprocess = channel.unary_unary(
                '/service.grpc.AlgService/Preprocess',
                request_serializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectRequest_.SerializeToString,
                response_deserializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.PreprocessResponse_.FromString,
                _registered_method=True)
        self.Detect = channel.unary_unary(
                '/service.grpc.AlgService/Detect',
                request_serializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectRequest_.SerializeToString,
                response_deserializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectResponse_.FromString,
                _registered_method=True)


class AlgServiceServicer(object):
    """Interface exported by the server.
    """

    def GetVersion(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 GetAlgorithms(self, request, context):
        """返回 当前支持的所有算法
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Preprocess(self, request, context):
        """预处理，在注册阶段， 背景图+ 图形+算法+参数 需要获取一段兹定于数据
        ： 输入 注册图像，检测任务列表，算法参数， 返回 预处理数据，这个数据应该调用者保存，将来在检测时
        使用  
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Detect(self, request, context):
        """检测： 输入 实时图像，检测任务列表， 返回 检测结果列表 

        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AlgServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.GetVersion,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.ServiceVersion_.SerializeToString,
            ),
            'GetAlgorithms': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAlgorithms,
                    request_deserializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.AlgorithmsRequest_.FromString,
                    response_serializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.AlgorithmsResponse_.SerializeToString,
            ),
            'Preprocess': grpc.unary_unary_rpc_method_handler(
                    servicer.Preprocess,
                    request_deserializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectRequest_.FromString,
                    response_serializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.PreprocessResponse_.SerializeToString,
            ),
            'Detect': grpc.unary_unary_rpc_method_handler(
                    servicer.Detect,
                    request_deserializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectRequest_.FromString,
                    response_serializer=algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectResponse_.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'service.grpc.AlgService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('service.grpc.AlgService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AlgService(object):
    """Interface exported by the server.
    """

    @staticmethod
    def GetVersion(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,
            '/service.grpc.AlgService/GetVersion',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            algservice_dot_services_dot_grpc_dot_alg__service__pb2.ServiceVersion_.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAlgorithms(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,
            '/service.grpc.AlgService/GetAlgorithms',
            algservice_dot_services_dot_grpc_dot_alg__service__pb2.AlgorithmsRequest_.SerializeToString,
            algservice_dot_services_dot_grpc_dot_alg__service__pb2.AlgorithmsResponse_.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Preprocess(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,
            '/service.grpc.AlgService/Preprocess',
            algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectRequest_.SerializeToString,
            algservice_dot_services_dot_grpc_dot_alg__service__pb2.PreprocessResponse_.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Detect(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,
            '/service.grpc.AlgService/Detect',
            algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectRequest_.SerializeToString,
            algservice_dot_services_dot_grpc_dot_alg__service__pb2.DetectResponse_.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
