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

from ..service_manage import client_pb2 as client__pb2
from ..service_manage import contract_pb2 as contract__pb2
from ..service_manage import heartbeat_pb2 as heartbeat__pb2
from ..service_manage import request_pb2 as request__pb2
from ..service_manage import response_pb2 as response__pb2
from ..service_manage import service_pb2 as service__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.ReportClient = channel.unary_unary(
                '/v1.PolarisGRPC/ReportClient',
                request_serializer=client__pb2.Client.SerializeToString,
                response_deserializer=response__pb2.Response.FromString,
                )
        self.RegisterInstance = channel.unary_unary(
                '/v1.PolarisGRPC/RegisterInstance',
                request_serializer=service__pb2.Instance.SerializeToString,
                response_deserializer=response__pb2.Response.FromString,
                )
        self.DeregisterInstance = channel.unary_unary(
                '/v1.PolarisGRPC/DeregisterInstance',
                request_serializer=service__pb2.Instance.SerializeToString,
                response_deserializer=response__pb2.Response.FromString,
                )
        self.Discover = channel.stream_stream(
                '/v1.PolarisGRPC/Discover',
                request_serializer=request__pb2.DiscoverRequest.SerializeToString,
                response_deserializer=response__pb2.DiscoverResponse.FromString,
                )
        self.Heartbeat = channel.unary_unary(
                '/v1.PolarisGRPC/Heartbeat',
                request_serializer=service__pb2.Instance.SerializeToString,
                response_deserializer=response__pb2.Response.FromString,
                )


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

    def ReportClient(self, request, context):
        """客户端上报
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RegisterInstance(self, request, context):
        """被调方注册服务实例
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeregisterInstance(self, request, context):
        """被调方反注册服务实例
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Discover(self, request_iterator, context):
        """统一发现接口
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Heartbeat(self, request, context):
        """被调方上报心跳
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PolarisGRPCServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ReportClient': grpc.unary_unary_rpc_method_handler(
                    servicer.ReportClient,
                    request_deserializer=client__pb2.Client.FromString,
                    response_serializer=response__pb2.Response.SerializeToString,
            ),
            'RegisterInstance': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterInstance,
                    request_deserializer=service__pb2.Instance.FromString,
                    response_serializer=response__pb2.Response.SerializeToString,
            ),
            'DeregisterInstance': grpc.unary_unary_rpc_method_handler(
                    servicer.DeregisterInstance,
                    request_deserializer=service__pb2.Instance.FromString,
                    response_serializer=response__pb2.Response.SerializeToString,
            ),
            'Discover': grpc.stream_stream_rpc_method_handler(
                    servicer.Discover,
                    request_deserializer=request__pb2.DiscoverRequest.FromString,
                    response_serializer=response__pb2.DiscoverResponse.SerializeToString,
            ),
            'Heartbeat': grpc.unary_unary_rpc_method_handler(
                    servicer.Heartbeat,
                    request_deserializer=service__pb2.Instance.FromString,
                    response_serializer=response__pb2.Response.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'v1.PolarisGRPC', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def ReportClient(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, '/v1.PolarisGRPC/ReportClient',
            client__pb2.Client.SerializeToString,
            response__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def RegisterInstance(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, '/v1.PolarisGRPC/RegisterInstance',
            service__pb2.Instance.SerializeToString,
            response__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeregisterInstance(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, '/v1.PolarisGRPC/DeregisterInstance',
            service__pb2.Instance.SerializeToString,
            response__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Discover(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/v1.PolarisGRPC/Discover',
            request__pb2.DiscoverRequest.SerializeToString,
            response__pb2.DiscoverResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Heartbeat(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, '/v1.PolarisGRPC/Heartbeat',
            service__pb2.Instance.SerializeToString,
            response__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.BatchHeartbeat = channel.stream_stream(
                '/v1.PolarisHeartbeatGRPC/BatchHeartbeat',
                request_serializer=heartbeat__pb2.HeartbeatsRequest.SerializeToString,
                response_deserializer=heartbeat__pb2.HeartbeatsResponse.FromString,
                )
        self.BatchGetHeartbeat = channel.unary_unary(
                '/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat',
                request_serializer=heartbeat__pb2.GetHeartbeatsRequest.SerializeToString,
                response_deserializer=heartbeat__pb2.GetHeartbeatsResponse.FromString,
                )
        self.BatchDelHeartbeat = channel.unary_unary(
                '/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat',
                request_serializer=heartbeat__pb2.DelHeartbeatsRequest.SerializeToString,
                response_deserializer=heartbeat__pb2.DelHeartbeatsResponse.FromString,
                )


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

    def BatchHeartbeat(self, request_iterator, context):
        """被调方批量上报心跳
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BatchGetHeartbeat(self, request, context):
        """批量获取心跳记录
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BatchDelHeartbeat(self, request, context):
        """批量删除心跳记录
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PolarisHeartbeatGRPCServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'BatchHeartbeat': grpc.stream_stream_rpc_method_handler(
                    servicer.BatchHeartbeat,
                    request_deserializer=heartbeat__pb2.HeartbeatsRequest.FromString,
                    response_serializer=heartbeat__pb2.HeartbeatsResponse.SerializeToString,
            ),
            'BatchGetHeartbeat': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchGetHeartbeat,
                    request_deserializer=heartbeat__pb2.GetHeartbeatsRequest.FromString,
                    response_serializer=heartbeat__pb2.GetHeartbeatsResponse.SerializeToString,
            ),
            'BatchDelHeartbeat': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchDelHeartbeat,
                    request_deserializer=heartbeat__pb2.DelHeartbeatsRequest.FromString,
                    response_serializer=heartbeat__pb2.DelHeartbeatsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'v1.PolarisHeartbeatGRPC', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def BatchHeartbeat(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/v1.PolarisHeartbeatGRPC/BatchHeartbeat',
            heartbeat__pb2.HeartbeatsRequest.SerializeToString,
            heartbeat__pb2.HeartbeatsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def BatchGetHeartbeat(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, '/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat',
            heartbeat__pb2.GetHeartbeatsRequest.SerializeToString,
            heartbeat__pb2.GetHeartbeatsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def BatchDelHeartbeat(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, '/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat',
            heartbeat__pb2.DelHeartbeatsRequest.SerializeToString,
            heartbeat__pb2.DelHeartbeatsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.ReportServiceContract = channel.unary_unary(
                '/v1.PolarisServiceContractGRPC/ReportServiceContract',
                request_serializer=contract__pb2.ServiceContract.SerializeToString,
                response_deserializer=response__pb2.Response.FromString,
                )


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

    def ReportServiceContract(self, request, context):
        """上报服务契约
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PolarisServiceContractGRPCServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ReportServiceContract': grpc.unary_unary_rpc_method_handler(
                    servicer.ReportServiceContract,
                    request_deserializer=contract__pb2.ServiceContract.FromString,
                    response_serializer=response__pb2.Response.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'v1.PolarisServiceContractGRPC', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def ReportServiceContract(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, '/v1.PolarisServiceContractGRPC/ReportServiceContract',
            contract__pb2.ServiceContract.SerializeToString,
            response__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
