# 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 v4_proto.dydxprotocol.clob import query_pb2 as dydxprotocol_dot_clob_dot_query__pb2

GRPC_GENERATED_VERSION = '1.65.4'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.66.0'
SCHEDULED_RELEASE_DATE = 'August 6, 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 dydxprotocol/clob/query_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 QueryStub(object):
    """Query defines the gRPC querier service.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ClobPair = channel.unary_unary(
                '/dydxprotocol.clob.Query/ClobPair',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryGetClobPairRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryClobPairResponse.FromString,
                _registered_method=True)
        self.ClobPairAll = channel.unary_unary(
                '/dydxprotocol.clob.Query/ClobPairAll',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryAllClobPairRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryClobPairAllResponse.FromString,
                _registered_method=True)
        self.MevNodeToNodeCalculation = channel.unary_unary(
                '/dydxprotocol.clob.Query/MevNodeToNodeCalculation',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.MevNodeToNodeCalculationRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.MevNodeToNodeCalculationResponse.FromString,
                _registered_method=True)
        self.EquityTierLimitConfiguration = channel.unary_unary(
                '/dydxprotocol.clob.Query/EquityTierLimitConfiguration',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryEquityTierLimitConfigurationRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryEquityTierLimitConfigurationResponse.FromString,
                _registered_method=True)
        self.BlockRateLimitConfiguration = channel.unary_unary(
                '/dydxprotocol.clob.Query/BlockRateLimitConfiguration',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryBlockRateLimitConfigurationRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryBlockRateLimitConfigurationResponse.FromString,
                _registered_method=True)
        self.LiquidationsConfiguration = channel.unary_unary(
                '/dydxprotocol.clob.Query/LiquidationsConfiguration',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryLiquidationsConfigurationRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryLiquidationsConfigurationResponse.FromString,
                _registered_method=True)
        self.StatefulOrder = channel.unary_unary(
                '/dydxprotocol.clob.Query/StatefulOrder',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryStatefulOrderRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryStatefulOrderResponse.FromString,
                _registered_method=True)
        self.StreamOrderbookUpdates = channel.unary_stream(
                '/dydxprotocol.clob.Query/StreamOrderbookUpdates',
                request_serializer=dydxprotocol_dot_clob_dot_query__pb2.StreamOrderbookUpdatesRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_clob_dot_query__pb2.StreamOrderbookUpdatesResponse.FromString,
                _registered_method=True)


class QueryServicer(object):
    """Query defines the gRPC querier service.
    """

    def ClobPair(self, request, context):
        """Queries a ClobPair by id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ClobPairAll(self, request, context):
        """Queries a list of ClobPair items.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def MevNodeToNodeCalculation(self, request, context):
        """Runs the MEV node <> node calculation with the provided parameters.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

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

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

    def StatefulOrder(self, request, context):
        """Queries the stateful order for a given order id.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamOrderbookUpdates(self, request, context):
        """GRPC Streams

        Streams orderbook updates. Updates contain orderbook data
        such as order placements, updates, and fills.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QueryServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ClobPair': grpc.unary_unary_rpc_method_handler(
                    servicer.ClobPair,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryGetClobPairRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryClobPairResponse.SerializeToString,
            ),
            'ClobPairAll': grpc.unary_unary_rpc_method_handler(
                    servicer.ClobPairAll,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryAllClobPairRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryClobPairAllResponse.SerializeToString,
            ),
            'MevNodeToNodeCalculation': grpc.unary_unary_rpc_method_handler(
                    servicer.MevNodeToNodeCalculation,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.MevNodeToNodeCalculationRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.MevNodeToNodeCalculationResponse.SerializeToString,
            ),
            'EquityTierLimitConfiguration': grpc.unary_unary_rpc_method_handler(
                    servicer.EquityTierLimitConfiguration,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryEquityTierLimitConfigurationRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryEquityTierLimitConfigurationResponse.SerializeToString,
            ),
            'BlockRateLimitConfiguration': grpc.unary_unary_rpc_method_handler(
                    servicer.BlockRateLimitConfiguration,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryBlockRateLimitConfigurationRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryBlockRateLimitConfigurationResponse.SerializeToString,
            ),
            'LiquidationsConfiguration': grpc.unary_unary_rpc_method_handler(
                    servicer.LiquidationsConfiguration,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryLiquidationsConfigurationRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryLiquidationsConfigurationResponse.SerializeToString,
            ),
            'StatefulOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.StatefulOrder,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.QueryStatefulOrderRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.QueryStatefulOrderResponse.SerializeToString,
            ),
            'StreamOrderbookUpdates': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamOrderbookUpdates,
                    request_deserializer=dydxprotocol_dot_clob_dot_query__pb2.StreamOrderbookUpdatesRequest.FromString,
                    response_serializer=dydxprotocol_dot_clob_dot_query__pb2.StreamOrderbookUpdatesResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.clob.Query', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('dydxprotocol.clob.Query', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Query(object):
    """Query defines the gRPC querier service.
    """

    @staticmethod
    def ClobPair(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,
            '/dydxprotocol.clob.Query/ClobPair',
            dydxprotocol_dot_clob_dot_query__pb2.QueryGetClobPairRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.QueryClobPairResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ClobPairAll(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,
            '/dydxprotocol.clob.Query/ClobPairAll',
            dydxprotocol_dot_clob_dot_query__pb2.QueryAllClobPairRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.QueryClobPairAllResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def MevNodeToNodeCalculation(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,
            '/dydxprotocol.clob.Query/MevNodeToNodeCalculation',
            dydxprotocol_dot_clob_dot_query__pb2.MevNodeToNodeCalculationRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.MevNodeToNodeCalculationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def EquityTierLimitConfiguration(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,
            '/dydxprotocol.clob.Query/EquityTierLimitConfiguration',
            dydxprotocol_dot_clob_dot_query__pb2.QueryEquityTierLimitConfigurationRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.QueryEquityTierLimitConfigurationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BlockRateLimitConfiguration(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,
            '/dydxprotocol.clob.Query/BlockRateLimitConfiguration',
            dydxprotocol_dot_clob_dot_query__pb2.QueryBlockRateLimitConfigurationRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.QueryBlockRateLimitConfigurationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def LiquidationsConfiguration(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,
            '/dydxprotocol.clob.Query/LiquidationsConfiguration',
            dydxprotocol_dot_clob_dot_query__pb2.QueryLiquidationsConfigurationRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.QueryLiquidationsConfigurationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StatefulOrder(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,
            '/dydxprotocol.clob.Query/StatefulOrder',
            dydxprotocol_dot_clob_dot_query__pb2.QueryStatefulOrderRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.QueryStatefulOrderResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamOrderbookUpdates(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_stream(
            request,
            target,
            '/dydxprotocol.clob.Query/StreamOrderbookUpdates',
            dydxprotocol_dot_clob_dot_query__pb2.StreamOrderbookUpdatesRequest.SerializeToString,
            dydxprotocol_dot_clob_dot_query__pb2.StreamOrderbookUpdatesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
