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

import common_pb2 as common__pb2


class CommonServiceStub(object):
    """The greeting service definition.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.getKline = channel.unary_unary(
                '/CommonService/getKline',
                request_serializer=common__pb2.KlineRequest.SerializeToString,
                response_deserializer=common__pb2.KlineReply.FromString,
                )
        self.getDepth = channel.unary_unary(
                '/CommonService/getDepth',
                request_serializer=common__pb2.DepthRequest.SerializeToString,
                response_deserializer=common__pb2.DepthReply.FromString,
                )
        self.getJumpPrice = channel.unary_unary(
                '/CommonService/getJumpPrice',
                request_serializer=common__pb2.JumpPriceRequest.SerializeToString,
                response_deserializer=common__pb2.JumpPriceReply.FromString,
                )
        self.spotOrder = channel.unary_unary(
                '/CommonService/spotOrder',
                request_serializer=common__pb2.SpotOrderRequest.SerializeToString,
                response_deserializer=common__pb2.SpotOrderReply.FromString,
                )
        self.batchSpotOrder = channel.unary_unary(
                '/CommonService/batchSpotOrder',
                request_serializer=common__pb2.BatchSpotOrderRequest.SerializeToString,
                response_deserializer=common__pb2.BatchSpotOrderReply.FromString,
                )
        self.futureOrder = channel.unary_unary(
                '/CommonService/futureOrder',
                request_serializer=common__pb2.FuturesOrderRequest.SerializeToString,
                response_deserializer=common__pb2.FuturesOrderReply.FromString,
                )
        self.batchFutureOrder = channel.unary_unary(
                '/CommonService/batchFutureOrder',
                request_serializer=common__pb2.BatchFutureOrderRequest.SerializeToString,
                response_deserializer=common__pb2.BatchFutureOrderReply.FromString,
                )
        self.cancelOrder = channel.unary_unary(
                '/CommonService/cancelOrder',
                request_serializer=common__pb2.CancelOrderRequest.SerializeToString,
                response_deserializer=common__pb2.CancelOrderReply.FromString,
                )
        self.getOrderInfoState = channel.unary_unary(
                '/CommonService/getOrderInfoState',
                request_serializer=common__pb2.OrderInfoStateRequest.SerializeToString,
                response_deserializer=common__pb2.OrderInfoStateReply.FromString,
                )
        self.getPosition = channel.unary_unary(
                '/CommonService/getPosition',
                request_serializer=common__pb2.BalanceRequest.SerializeToString,
                response_deserializer=common__pb2.BalanceReply.FromString,
                )
        self.getBalanceUsdt = channel.unary_unary(
                '/CommonService/getBalanceUsdt',
                request_serializer=common__pb2.UsdtRequest.SerializeToString,
                response_deserializer=common__pb2.UsdtReply.FromString,
                )
        self.getCapital = channel.unary_unary(
                '/CommonService/getCapital',
                request_serializer=common__pb2.CapitalRequest.SerializeToString,
                response_deserializer=common__pb2.CapitalReply.FromString,
                )
        self.getLastPrice = channel.unary_unary(
                '/CommonService/getLastPrice',
                request_serializer=common__pb2.LastPriceRequest.SerializeToString,
                response_deserializer=common__pb2.LastPriceReply.FromString,
                )
        self.getPositionByTransferId = channel.unary_unary(
                '/CommonService/getPositionByTransferId',
                request_serializer=common__pb2.TransferPositionRequest.SerializeToString,
                response_deserializer=common__pb2.TransferPositionReply.FromString,
                )
        self.stopStrategy = channel.unary_unary(
                '/CommonService/stopStrategy',
                request_serializer=common__pb2.StopRequest.SerializeToString,
                response_deserializer=common__pb2.StopReply.FromString,
                )
        self.addTradeLog = channel.unary_unary(
                '/CommonService/addTradeLog',
                request_serializer=common__pb2.LogRequest.SerializeToString,
                response_deserializer=common__pb2.LogReply.FromString,
                )
        self.transfer = channel.unary_unary(
                '/CommonService/transfer',
                request_serializer=common__pb2.TransferRequest.SerializeToString,
                response_deserializer=common__pb2.TransferReply.FromString,
                )


class CommonServiceServicer(object):
    """The greeting service definition.
    """

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

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

    def getJumpPrice(self, request, context):
        """获取跳价
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def spotOrder(self, request, context):
        """币币下单
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def batchSpotOrder(self, request, context):
        """币币下单(批量)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def futureOrder(self, request, context):
        """合约下单
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def batchFutureOrder(self, request, context):
        """合约下单(批量)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def cancelOrder(self, request, context):
        """取消下单
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getOrderInfoState(self, request, context):
        """订单详情(返回订单的状态)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getPosition(self, request, context):
        """获取持仓数量
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getBalanceUsdt(self, request, context):
        """获取币币的usdt数量，只有币币
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getCapital(self, request, context):
        """获取合约和币币的资产
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getLastPrice(self, request, context):
        """获取最新价格
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getPositionByTransferId(self, request, context):
        """获取交易的最新持仓信息
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def stopStrategy(self, request, context):
        """停止策略
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def addTradeLog(self, request, context):
        """添加交易日志
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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


def add_CommonServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'getKline': grpc.unary_unary_rpc_method_handler(
                    servicer.getKline,
                    request_deserializer=common__pb2.KlineRequest.FromString,
                    response_serializer=common__pb2.KlineReply.SerializeToString,
            ),
            'getDepth': grpc.unary_unary_rpc_method_handler(
                    servicer.getDepth,
                    request_deserializer=common__pb2.DepthRequest.FromString,
                    response_serializer=common__pb2.DepthReply.SerializeToString,
            ),
            'getJumpPrice': grpc.unary_unary_rpc_method_handler(
                    servicer.getJumpPrice,
                    request_deserializer=common__pb2.JumpPriceRequest.FromString,
                    response_serializer=common__pb2.JumpPriceReply.SerializeToString,
            ),
            'spotOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.spotOrder,
                    request_deserializer=common__pb2.SpotOrderRequest.FromString,
                    response_serializer=common__pb2.SpotOrderReply.SerializeToString,
            ),
            'batchSpotOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.batchSpotOrder,
                    request_deserializer=common__pb2.BatchSpotOrderRequest.FromString,
                    response_serializer=common__pb2.BatchSpotOrderReply.SerializeToString,
            ),
            'futureOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.futureOrder,
                    request_deserializer=common__pb2.FuturesOrderRequest.FromString,
                    response_serializer=common__pb2.FuturesOrderReply.SerializeToString,
            ),
            'batchFutureOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.batchFutureOrder,
                    request_deserializer=common__pb2.BatchFutureOrderRequest.FromString,
                    response_serializer=common__pb2.BatchFutureOrderReply.SerializeToString,
            ),
            'cancelOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.cancelOrder,
                    request_deserializer=common__pb2.CancelOrderRequest.FromString,
                    response_serializer=common__pb2.CancelOrderReply.SerializeToString,
            ),
            'getOrderInfoState': grpc.unary_unary_rpc_method_handler(
                    servicer.getOrderInfoState,
                    request_deserializer=common__pb2.OrderInfoStateRequest.FromString,
                    response_serializer=common__pb2.OrderInfoStateReply.SerializeToString,
            ),
            'getPosition': grpc.unary_unary_rpc_method_handler(
                    servicer.getPosition,
                    request_deserializer=common__pb2.BalanceRequest.FromString,
                    response_serializer=common__pb2.BalanceReply.SerializeToString,
            ),
            'getBalanceUsdt': grpc.unary_unary_rpc_method_handler(
                    servicer.getBalanceUsdt,
                    request_deserializer=common__pb2.UsdtRequest.FromString,
                    response_serializer=common__pb2.UsdtReply.SerializeToString,
            ),
            'getCapital': grpc.unary_unary_rpc_method_handler(
                    servicer.getCapital,
                    request_deserializer=common__pb2.CapitalRequest.FromString,
                    response_serializer=common__pb2.CapitalReply.SerializeToString,
            ),
            'getLastPrice': grpc.unary_unary_rpc_method_handler(
                    servicer.getLastPrice,
                    request_deserializer=common__pb2.LastPriceRequest.FromString,
                    response_serializer=common__pb2.LastPriceReply.SerializeToString,
            ),
            'getPositionByTransferId': grpc.unary_unary_rpc_method_handler(
                    servicer.getPositionByTransferId,
                    request_deserializer=common__pb2.TransferPositionRequest.FromString,
                    response_serializer=common__pb2.TransferPositionReply.SerializeToString,
            ),
            'stopStrategy': grpc.unary_unary_rpc_method_handler(
                    servicer.stopStrategy,
                    request_deserializer=common__pb2.StopRequest.FromString,
                    response_serializer=common__pb2.StopReply.SerializeToString,
            ),
            'addTradeLog': grpc.unary_unary_rpc_method_handler(
                    servicer.addTradeLog,
                    request_deserializer=common__pb2.LogRequest.FromString,
                    response_serializer=common__pb2.LogReply.SerializeToString,
            ),
            'transfer': grpc.unary_unary_rpc_method_handler(
                    servicer.transfer,
                    request_deserializer=common__pb2.TransferRequest.FromString,
                    response_serializer=common__pb2.TransferReply.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'CommonService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class CommonService(object):
    """The greeting service definition.
    """

    @staticmethod
    def getKline(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, '/CommonService/getKline',
            common__pb2.KlineRequest.SerializeToString,
            common__pb2.KlineReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getDepth(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, '/CommonService/getDepth',
            common__pb2.DepthRequest.SerializeToString,
            common__pb2.DepthReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getJumpPrice(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, '/CommonService/getJumpPrice',
            common__pb2.JumpPriceRequest.SerializeToString,
            common__pb2.JumpPriceReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def spotOrder(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, '/CommonService/spotOrder',
            common__pb2.SpotOrderRequest.SerializeToString,
            common__pb2.SpotOrderReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def batchSpotOrder(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, '/CommonService/batchSpotOrder',
            common__pb2.BatchSpotOrderRequest.SerializeToString,
            common__pb2.BatchSpotOrderReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def futureOrder(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, '/CommonService/futureOrder',
            common__pb2.FuturesOrderRequest.SerializeToString,
            common__pb2.FuturesOrderReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def batchFutureOrder(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, '/CommonService/batchFutureOrder',
            common__pb2.BatchFutureOrderRequest.SerializeToString,
            common__pb2.BatchFutureOrderReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def cancelOrder(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, '/CommonService/cancelOrder',
            common__pb2.CancelOrderRequest.SerializeToString,
            common__pb2.CancelOrderReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getOrderInfoState(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, '/CommonService/getOrderInfoState',
            common__pb2.OrderInfoStateRequest.SerializeToString,
            common__pb2.OrderInfoStateReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getPosition(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, '/CommonService/getPosition',
            common__pb2.BalanceRequest.SerializeToString,
            common__pb2.BalanceReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getBalanceUsdt(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, '/CommonService/getBalanceUsdt',
            common__pb2.UsdtRequest.SerializeToString,
            common__pb2.UsdtReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getCapital(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, '/CommonService/getCapital',
            common__pb2.CapitalRequest.SerializeToString,
            common__pb2.CapitalReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getLastPrice(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, '/CommonService/getLastPrice',
            common__pb2.LastPriceRequest.SerializeToString,
            common__pb2.LastPriceReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getPositionByTransferId(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, '/CommonService/getPositionByTransferId',
            common__pb2.TransferPositionRequest.SerializeToString,
            common__pb2.TransferPositionReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def stopStrategy(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, '/CommonService/stopStrategy',
            common__pb2.StopRequest.SerializeToString,
            common__pb2.StopReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def addTradeLog(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, '/CommonService/addTradeLog',
            common__pb2.LogRequest.SerializeToString,
            common__pb2.LogReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def transfer(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, '/CommonService/transfer',
            common__pb2.TransferRequest.SerializeToString,
            common__pb2.TransferReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
