# 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.stats import query_pb2 as dydxprotocol_dot_stats_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/stats/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.Params = channel.unary_unary(
                '/dydxprotocol.stats.Query/Params',
                request_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryParamsRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryParamsResponse.FromString,
                _registered_method=True)
        self.StatsMetadata = channel.unary_unary(
                '/dydxprotocol.stats.Query/StatsMetadata',
                request_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryStatsMetadataRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryStatsMetadataResponse.FromString,
                _registered_method=True)
        self.GlobalStats = channel.unary_unary(
                '/dydxprotocol.stats.Query/GlobalStats',
                request_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryGlobalStatsRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryGlobalStatsResponse.FromString,
                _registered_method=True)
        self.UserStats = channel.unary_unary(
                '/dydxprotocol.stats.Query/UserStats',
                request_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryUserStatsRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryUserStatsResponse.FromString,
                _registered_method=True)


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

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

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

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

    def UserStats(self, request, context):
        """Queries UserStats.
        """
        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 = {
            'Params': grpc.unary_unary_rpc_method_handler(
                    servicer.Params,
                    request_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryParamsRequest.FromString,
                    response_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryParamsResponse.SerializeToString,
            ),
            'StatsMetadata': grpc.unary_unary_rpc_method_handler(
                    servicer.StatsMetadata,
                    request_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryStatsMetadataRequest.FromString,
                    response_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryStatsMetadataResponse.SerializeToString,
            ),
            'GlobalStats': grpc.unary_unary_rpc_method_handler(
                    servicer.GlobalStats,
                    request_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryGlobalStatsRequest.FromString,
                    response_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryGlobalStatsResponse.SerializeToString,
            ),
            'UserStats': grpc.unary_unary_rpc_method_handler(
                    servicer.UserStats,
                    request_deserializer=dydxprotocol_dot_stats_dot_query__pb2.QueryUserStatsRequest.FromString,
                    response_serializer=dydxprotocol_dot_stats_dot_query__pb2.QueryUserStatsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.stats.Query', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('dydxprotocol.stats.Query', rpc_method_handlers)


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

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

    @staticmethod
    def StatsMetadata(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.stats.Query/StatsMetadata',
            dydxprotocol_dot_stats_dot_query__pb2.QueryStatsMetadataRequest.SerializeToString,
            dydxprotocol_dot_stats_dot_query__pb2.QueryStatsMetadataResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GlobalStats(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.stats.Query/GlobalStats',
            dydxprotocol_dot_stats_dot_query__pb2.QueryGlobalStatsRequest.SerializeToString,
            dydxprotocol_dot_stats_dot_query__pb2.QueryGlobalStatsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UserStats(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.stats.Query/UserStats',
            dydxprotocol_dot_stats_dot_query__pb2.QueryUserStatsRequest.SerializeToString,
            dydxprotocol_dot_stats_dot_query__pb2.QueryUserStatsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
