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

from pyinjective.proto.exchange import health_pb2 as exchange_dot_health__pb2


class HealthStub(object):
    """HealthAPI allows to check if backend data is up-to-date and reliable or not.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetStatus = channel.unary_unary(
                '/api.v1.Health/GetStatus',
                request_serializer=exchange_dot_health__pb2.GetStatusRequest.SerializeToString,
                response_deserializer=exchange_dot_health__pb2.GetStatusResponse.FromString,
                _registered_method=True)


class HealthServicer(object):
    """HealthAPI allows to check if backend data is up-to-date and reliable or not.
    """

    def GetStatus(self, request, context):
        """Get current backend health status
        """
        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 = {
            'GetStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStatus,
                    request_deserializer=exchange_dot_health__pb2.GetStatusRequest.FromString,
                    response_serializer=exchange_dot_health__pb2.GetStatusResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'api.v1.Health', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('api.v1.Health', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Health(object):
    """HealthAPI allows to check if backend data is up-to-date and reliable or not.
    """

    @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,
            '/api.v1.Health/GetStatus',
            exchange_dot_health__pb2.GetStatusRequest.SerializeToString,
            exchange_dot_health__pb2.GetStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
