# 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 injective_chart_rpc_pb2 as exchange_dot_injective__chart__rpc__pb2


class InjectiveChartRPCStub(object):
    """InjectiveChartRPC implements historical chart data retrieval.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SpotMarketHistory = channel.unary_unary(
                '/injective_chart_rpc.InjectiveChartRPC/SpotMarketHistory',
                request_serializer=exchange_dot_injective__chart__rpc__pb2.SpotMarketHistoryRequest.SerializeToString,
                response_deserializer=exchange_dot_injective__chart__rpc__pb2.SpotMarketHistoryResponse.FromString,
                _registered_method=True)
        self.DerivativeMarketHistory = channel.unary_unary(
                '/injective_chart_rpc.InjectiveChartRPC/DerivativeMarketHistory',
                request_serializer=exchange_dot_injective__chart__rpc__pb2.DerivativeMarketHistoryRequest.SerializeToString,
                response_deserializer=exchange_dot_injective__chart__rpc__pb2.DerivativeMarketHistoryResponse.FromString,
                _registered_method=True)


class InjectiveChartRPCServicer(object):
    """InjectiveChartRPC implements historical chart data retrieval.
    """

    def SpotMarketHistory(self, request, context):
        """Request for history bars of spotMarket for TradingView.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DerivativeMarketHistory(self, request, context):
        """Request for history bars of derivativeMarket for TradingView.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_InjectiveChartRPCServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SpotMarketHistory': grpc.unary_unary_rpc_method_handler(
                    servicer.SpotMarketHistory,
                    request_deserializer=exchange_dot_injective__chart__rpc__pb2.SpotMarketHistoryRequest.FromString,
                    response_serializer=exchange_dot_injective__chart__rpc__pb2.SpotMarketHistoryResponse.SerializeToString,
            ),
            'DerivativeMarketHistory': grpc.unary_unary_rpc_method_handler(
                    servicer.DerivativeMarketHistory,
                    request_deserializer=exchange_dot_injective__chart__rpc__pb2.DerivativeMarketHistoryRequest.FromString,
                    response_serializer=exchange_dot_injective__chart__rpc__pb2.DerivativeMarketHistoryResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'injective_chart_rpc.InjectiveChartRPC', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('injective_chart_rpc.InjectiveChartRPC', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class InjectiveChartRPC(object):
    """InjectiveChartRPC implements historical chart data retrieval.
    """

    @staticmethod
    def SpotMarketHistory(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,
            '/injective_chart_rpc.InjectiveChartRPC/SpotMarketHistory',
            exchange_dot_injective__chart__rpc__pb2.SpotMarketHistoryRequest.SerializeToString,
            exchange_dot_injective__chart__rpc__pb2.SpotMarketHistoryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DerivativeMarketHistory(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,
            '/injective_chart_rpc.InjectiveChartRPC/DerivativeMarketHistory',
            exchange_dot_injective__chart__rpc__pb2.DerivativeMarketHistoryRequest.SerializeToString,
            exchange_dot_injective__chart__rpc__pb2.DerivativeMarketHistoryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
