Subversion Repositories SmartDukaan

Rev

Rev 1731 | Rev 2446 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1731 Rev 1886
Line 338... Line 338...
338
    Returns the minimum and maximum amounts of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
338
    Returns the minimum and maximum amounts of a valid order. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
339
    List contains two values, first minimum amount and second maximum amount.
339
    List contains two values, first minimum amount and second maximum amount.
340
    """
340
    """
341
    pass
341
    pass
342
 
342
 
-
 
343
  def getValidOrders(self, limit):
-
 
344
    """
-
 
345
    Returns list of Orders in descending order by Order creation date. List is restricted to limit Orders.
-
 
346
    If limit is passed as 0, then all valid Orders are returned.
-
 
347
    
-
 
348
    Parameters:
-
 
349
     - limit
-
 
350
    """
-
 
351
    pass
-
 
352
 
343
 
353
 
344
class Client(Iface):
354
class Client(Iface):
345
  def __init__(self, iprot, oprot=None):
355
  def __init__(self, iprot, oprot=None):
346
    self._iprot = self._oprot = iprot
356
    self._iprot = self._oprot = iprot
347
    if oprot != None:
357
    if oprot != None:
Line 1575... Line 1585...
1575
    self._iprot.readMessageEnd()
1585
    self._iprot.readMessageEnd()
1576
    if result.success != None:
1586
    if result.success != None:
1577
      return result.success
1587
      return result.success
1578
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrdersAmountRange failed: unknown result");
1588
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrdersAmountRange failed: unknown result");
1579
 
1589
 
-
 
1590
  def getValidOrders(self, limit):
-
 
1591
    """
-
 
1592
    Returns list of Orders in descending order by Order creation date. List is restricted to limit Orders.
-
 
1593
    If limit is passed as 0, then all valid Orders are returned.
-
 
1594
    
-
 
1595
    Parameters:
-
 
1596
     - limit
-
 
1597
    """
-
 
1598
    self.send_getValidOrders(limit)
-
 
1599
    return self.recv_getValidOrders()
-
 
1600
 
-
 
1601
  def send_getValidOrders(self, limit):
-
 
1602
    self._oprot.writeMessageBegin('getValidOrders', TMessageType.CALL, self._seqid)
-
 
1603
    args = getValidOrders_args()
-
 
1604
    args.limit = limit
-
 
1605
    args.write(self._oprot)
-
 
1606
    self._oprot.writeMessageEnd()
-
 
1607
    self._oprot.trans.flush()
-
 
1608
 
-
 
1609
  def recv_getValidOrders(self, ):
-
 
1610
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1611
    if mtype == TMessageType.EXCEPTION:
-
 
1612
      x = TApplicationException()
-
 
1613
      x.read(self._iprot)
-
 
1614
      self._iprot.readMessageEnd()
-
 
1615
      raise x
-
 
1616
    result = getValidOrders_result()
-
 
1617
    result.read(self._iprot)
-
 
1618
    self._iprot.readMessageEnd()
-
 
1619
    if result.success != None:
-
 
1620
      return result.success
-
 
1621
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrders failed: unknown result");
-
 
1622
 
1580
 
1623
 
1581
class Processor(Iface, TProcessor):
1624
class Processor(Iface, TProcessor):
1582
  def __init__(self, handler):
1625
  def __init__(self, handler):
1583
    self._handler = handler
1626
    self._handler = handler
1584
    self._processMap = {}
1627
    self._processMap = {}
Line 1616... Line 1659...
1616
    self._processMap["getAlerts"] = Processor.process_getAlerts
1659
    self._processMap["getAlerts"] = Processor.process_getAlerts
1617
    self._processMap["setAlert"] = Processor.process_setAlert
1660
    self._processMap["setAlert"] = Processor.process_setAlert
1618
    self._processMap["getValidOrderCount"] = Processor.process_getValidOrderCount
1661
    self._processMap["getValidOrderCount"] = Processor.process_getValidOrderCount
1619
    self._processMap["getNoOfCustomersWithSuccessfulTransaction"] = Processor.process_getNoOfCustomersWithSuccessfulTransaction
1662
    self._processMap["getNoOfCustomersWithSuccessfulTransaction"] = Processor.process_getNoOfCustomersWithSuccessfulTransaction
1620
    self._processMap["getValidOrdersAmountRange"] = Processor.process_getValidOrdersAmountRange
1663
    self._processMap["getValidOrdersAmountRange"] = Processor.process_getValidOrdersAmountRange
-
 
1664
    self._processMap["getValidOrders"] = Processor.process_getValidOrders
1621
 
1665
 
1622
  def process(self, iprot, oprot):
1666
  def process(self, iprot, oprot):
1623
    (name, type, seqid) = iprot.readMessageBegin()
1667
    (name, type, seqid) = iprot.readMessageBegin()
1624
    if name not in self._processMap:
1668
    if name not in self._processMap:
1625
      iprot.skip(TType.STRUCT)
1669
      iprot.skip(TType.STRUCT)
Line 2115... Line 2159...
2115
    oprot.writeMessageBegin("getValidOrdersAmountRange", TMessageType.REPLY, seqid)
2159
    oprot.writeMessageBegin("getValidOrdersAmountRange", TMessageType.REPLY, seqid)
2116
    result.write(oprot)
2160
    result.write(oprot)
2117
    oprot.writeMessageEnd()
2161
    oprot.writeMessageEnd()
2118
    oprot.trans.flush()
2162
    oprot.trans.flush()
2119
 
2163
 
-
 
2164
  def process_getValidOrders(self, seqid, iprot, oprot):
-
 
2165
    args = getValidOrders_args()
-
 
2166
    args.read(iprot)
-
 
2167
    iprot.readMessageEnd()
-
 
2168
    result = getValidOrders_result()
-
 
2169
    result.success = self._handler.getValidOrders(args.limit)
-
 
2170
    oprot.writeMessageBegin("getValidOrders", TMessageType.REPLY, seqid)
-
 
2171
    result.write(oprot)
-
 
2172
    oprot.writeMessageEnd()
-
 
2173
    oprot.trans.flush()
-
 
2174
 
2120
 
2175
 
2121
# HELPER FUNCTIONS AND STRUCTURES
2176
# HELPER FUNCTIONS AND STRUCTURES
2122
 
2177
 
2123
class closeSession_args:
2178
class closeSession_args:
2124
 
2179
 
Line 6905... Line 6960...
6905
      oprot.writeListEnd()
6960
      oprot.writeListEnd()
6906
      oprot.writeFieldEnd()
6961
      oprot.writeFieldEnd()
6907
    oprot.writeFieldStop()
6962
    oprot.writeFieldStop()
6908
    oprot.writeStructEnd()
6963
    oprot.writeStructEnd()
6909
 
6964
 
-
 
6965
  def __repr__(self):
-
 
6966
    L = ['%s=%r' % (key, value)
-
 
6967
      for key, value in self.__dict__.iteritems()]
-
 
6968
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
6969
 
-
 
6970
  def __eq__(self, other):
-
 
6971
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
6972
 
-
 
6973
  def __ne__(self, other):
-
 
6974
    return not (self == other)
-
 
6975
 
-
 
6976
class getValidOrders_args:
-
 
6977
  """
-
 
6978
  Attributes:
-
 
6979
   - limit
-
 
6980
  """
-
 
6981
 
-
 
6982
  thrift_spec = (
-
 
6983
    None, # 0
-
 
6984
    (1, TType.I64, 'limit', None, None, ), # 1
-
 
6985
  )
-
 
6986
 
-
 
6987
  def __init__(self, limit=None,):
-
 
6988
    self.limit = limit
-
 
6989
 
-
 
6990
  def read(self, iprot):
-
 
6991
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
6992
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
6993
      return
-
 
6994
    iprot.readStructBegin()
-
 
6995
    while True:
-
 
6996
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
6997
      if ftype == TType.STOP:
-
 
6998
        break
-
 
6999
      if fid == 1:
-
 
7000
        if ftype == TType.I64:
-
 
7001
          self.limit = iprot.readI64();
-
 
7002
        else:
-
 
7003
          iprot.skip(ftype)
-
 
7004
      else:
-
 
7005
        iprot.skip(ftype)
-
 
7006
      iprot.readFieldEnd()
-
 
7007
    iprot.readStructEnd()
-
 
7008
 
-
 
7009
  def write(self, oprot):
-
 
7010
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
7011
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
7012
      return
-
 
7013
    oprot.writeStructBegin('getValidOrders_args')
-
 
7014
    if self.limit != None:
-
 
7015
      oprot.writeFieldBegin('limit', TType.I64, 1)
-
 
7016
      oprot.writeI64(self.limit)
-
 
7017
      oprot.writeFieldEnd()
-
 
7018
    oprot.writeFieldStop()
-
 
7019
    oprot.writeStructEnd()
-
 
7020
 
-
 
7021
  def __repr__(self):
-
 
7022
    L = ['%s=%r' % (key, value)
-
 
7023
      for key, value in self.__dict__.iteritems()]
-
 
7024
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
7025
 
-
 
7026
  def __eq__(self, other):
-
 
7027
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
7028
 
-
 
7029
  def __ne__(self, other):
-
 
7030
    return not (self == other)
-
 
7031
 
-
 
7032
class getValidOrders_result:
-
 
7033
  """
-
 
7034
  Attributes:
-
 
7035
   - success
-
 
7036
  """
-
 
7037
 
-
 
7038
  thrift_spec = (
-
 
7039
    (0, TType.LIST, 'success', (TType.STRUCT,(Order, Order.thrift_spec)), None, ), # 0
-
 
7040
  )
-
 
7041
 
-
 
7042
  def __init__(self, success=None,):
-
 
7043
    self.success = success
-
 
7044
 
-
 
7045
  def read(self, iprot):
-
 
7046
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
7047
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
7048
      return
-
 
7049
    iprot.readStructBegin()
-
 
7050
    while True:
-
 
7051
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
7052
      if ftype == TType.STOP:
-
 
7053
        break
-
 
7054
      if fid == 0:
-
 
7055
        if ftype == TType.LIST:
-
 
7056
          self.success = []
-
 
7057
          (_etype151, _size148) = iprot.readListBegin()
-
 
7058
          for _i152 in xrange(_size148):
-
 
7059
            _elem153 = Order()
-
 
7060
            _elem153.read(iprot)
-
 
7061
            self.success.append(_elem153)
-
 
7062
          iprot.readListEnd()
-
 
7063
        else:
-
 
7064
          iprot.skip(ftype)
-
 
7065
      else:
-
 
7066
        iprot.skip(ftype)
-
 
7067
      iprot.readFieldEnd()
-
 
7068
    iprot.readStructEnd()
-
 
7069
 
-
 
7070
  def write(self, oprot):
-
 
7071
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
7072
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
7073
      return
-
 
7074
    oprot.writeStructBegin('getValidOrders_result')
-
 
7075
    if self.success != None:
-
 
7076
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
7077
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
7078
      for iter154 in self.success:
-
 
7079
        iter154.write(oprot)
-
 
7080
      oprot.writeListEnd()
-
 
7081
      oprot.writeFieldEnd()
-
 
7082
    oprot.writeFieldStop()
-
 
7083
    oprot.writeStructEnd()
-
 
7084
 
6910
  def __repr__(self):
7085
  def __repr__(self):
6911
    L = ['%s=%r' % (key, value)
7086
    L = ['%s=%r' % (key, value)
6912
      for key, value in self.__dict__.iteritems()]
7087
      for key, value in self.__dict__.iteritems()]
6913
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
7088
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
6914
 
7089