# 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.perpetuals import query_pb2 as dydxprotocol_dot_perpetuals_dot_query__pb2

GRPC_GENERATED_VERSION = '1.75.1'
GRPC_VERSION = grpc.__version__
_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:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in dydxprotocol/perpetuals/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}.'
    )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Perpetual = channel.unary_unary(
                '/dydxprotocol.perpetuals.Query/Perpetual',
                request_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPerpetualRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPerpetualResponse.FromString,
                _registered_method=True)
        self.AllPerpetuals = channel.unary_unary(
                '/dydxprotocol.perpetuals.Query/AllPerpetuals',
                request_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllPerpetualsRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllPerpetualsResponse.FromString,
                _registered_method=True)
        self.AllLiquidityTiers = channel.unary_unary(
                '/dydxprotocol.perpetuals.Query/AllLiquidityTiers',
                request_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllLiquidityTiersRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllLiquidityTiersResponse.FromString,
                _registered_method=True)
        self.PremiumVotes = channel.unary_unary(
                '/dydxprotocol.perpetuals.Query/PremiumVotes',
                request_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumVotesRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumVotesResponse.FromString,
                _registered_method=True)
        self.PremiumSamples = channel.unary_unary(
                '/dydxprotocol.perpetuals.Query/PremiumSamples',
                request_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumSamplesRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumSamplesResponse.FromString,
                _registered_method=True)
        self.Params = channel.unary_unary(
                '/dydxprotocol.perpetuals.Query/Params',
                request_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryParamsRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryParamsResponse.FromString,
                _registered_method=True)
        self.NextPerpetualId = channel.unary_unary(
                '/dydxprotocol.perpetuals.Query/NextPerpetualId',
                request_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryNextPerpetualIdRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryNextPerpetualIdResponse.FromString,
                _registered_method=True)


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

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

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

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

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

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

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

    def NextPerpetualId(self, request, context):
        """Queries the next perpetual id.
        """
        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 = {
            'Perpetual': grpc.unary_unary_rpc_method_handler(
                    servicer.Perpetual,
                    request_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPerpetualRequest.FromString,
                    response_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPerpetualResponse.SerializeToString,
            ),
            'AllPerpetuals': grpc.unary_unary_rpc_method_handler(
                    servicer.AllPerpetuals,
                    request_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllPerpetualsRequest.FromString,
                    response_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllPerpetualsResponse.SerializeToString,
            ),
            'AllLiquidityTiers': grpc.unary_unary_rpc_method_handler(
                    servicer.AllLiquidityTiers,
                    request_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllLiquidityTiersRequest.FromString,
                    response_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllLiquidityTiersResponse.SerializeToString,
            ),
            'PremiumVotes': grpc.unary_unary_rpc_method_handler(
                    servicer.PremiumVotes,
                    request_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumVotesRequest.FromString,
                    response_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumVotesResponse.SerializeToString,
            ),
            'PremiumSamples': grpc.unary_unary_rpc_method_handler(
                    servicer.PremiumSamples,
                    request_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumSamplesRequest.FromString,
                    response_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumSamplesResponse.SerializeToString,
            ),
            'Params': grpc.unary_unary_rpc_method_handler(
                    servicer.Params,
                    request_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryParamsRequest.FromString,
                    response_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryParamsResponse.SerializeToString,
            ),
            'NextPerpetualId': grpc.unary_unary_rpc_method_handler(
                    servicer.NextPerpetualId,
                    request_deserializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryNextPerpetualIdRequest.FromString,
                    response_serializer=dydxprotocol_dot_perpetuals_dot_query__pb2.QueryNextPerpetualIdResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.perpetuals.Query', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('dydxprotocol.perpetuals.Query', rpc_method_handlers)


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

    @staticmethod
    def Perpetual(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.perpetuals.Query/Perpetual',
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPerpetualRequest.SerializeToString,
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPerpetualResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AllPerpetuals(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.perpetuals.Query/AllPerpetuals',
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllPerpetualsRequest.SerializeToString,
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllPerpetualsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AllLiquidityTiers(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.perpetuals.Query/AllLiquidityTiers',
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllLiquidityTiersRequest.SerializeToString,
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryAllLiquidityTiersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PremiumVotes(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.perpetuals.Query/PremiumVotes',
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumVotesRequest.SerializeToString,
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumVotesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PremiumSamples(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.perpetuals.Query/PremiumSamples',
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumSamplesRequest.SerializeToString,
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryPremiumSamplesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Params(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.perpetuals.Query/Params',
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryParamsRequest.SerializeToString,
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryParamsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def NextPerpetualId(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.perpetuals.Query/NextPerpetualId',
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryNextPerpetualIdRequest.SerializeToString,
            dydxprotocol_dot_perpetuals_dot_query__pb2.QueryNextPerpetualIdResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
