Subversion Repositories SmartDukaan

Rev

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

Rev 1528 Rev 1596
Line 319... Line 319...
319
     - type
319
     - type
320
     - comment
320
     - comment
321
    """
321
    """
322
    pass
322
    pass
323
 
323
 
-
 
324
  def getValidOrderCount(self, ):
-
 
325
    """
-
 
326
    Return the number of valid orders. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
-
 
327
    """
-
 
328
    pass
-
 
329
 
324
 
330
 
325
class Client(Iface):
331
class Client(Iface):
326
  def __init__(self, iprot, oprot=None):
332
  def __init__(self, iprot, oprot=None):
327
    self._iprot = self._oprot = iprot
333
    self._iprot = self._oprot = iprot
328
    if oprot != None:
334
    if oprot != None:
Line 1471... Line 1477...
1471
    result = setAlert_result()
1477
    result = setAlert_result()
1472
    result.read(self._iprot)
1478
    result.read(self._iprot)
1473
    self._iprot.readMessageEnd()
1479
    self._iprot.readMessageEnd()
1474
    return
1480
    return
1475
 
1481
 
-
 
1482
  def getValidOrderCount(self, ):
-
 
1483
    """
-
 
1484
    Return the number of valid orders. (OrderStatus >= OrderStatus.SUBMITTED_FOR_PROCESSING)
-
 
1485
    """
-
 
1486
    self.send_getValidOrderCount()
-
 
1487
    return self.recv_getValidOrderCount()
-
 
1488
 
-
 
1489
  def send_getValidOrderCount(self, ):
-
 
1490
    self._oprot.writeMessageBegin('getValidOrderCount', TMessageType.CALL, self._seqid)
-
 
1491
    args = getValidOrderCount_args()
-
 
1492
    args.write(self._oprot)
-
 
1493
    self._oprot.writeMessageEnd()
-
 
1494
    self._oprot.trans.flush()
-
 
1495
 
-
 
1496
  def recv_getValidOrderCount(self, ):
-
 
1497
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1498
    if mtype == TMessageType.EXCEPTION:
-
 
1499
      x = TApplicationException()
-
 
1500
      x.read(self._iprot)
-
 
1501
      self._iprot.readMessageEnd()
-
 
1502
      raise x
-
 
1503
    result = getValidOrderCount_result()
-
 
1504
    result.read(self._iprot)
-
 
1505
    self._iprot.readMessageEnd()
-
 
1506
    if result.success != None:
-
 
1507
      return result.success
-
 
1508
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getValidOrderCount failed: unknown result");
-
 
1509
 
1476
 
1510
 
1477
class Processor(Iface, TProcessor):
1511
class Processor(Iface, TProcessor):
1478
  def __init__(self, handler):
1512
  def __init__(self, handler):
1479
    self._handler = handler
1513
    self._handler = handler
1480
    self._processMap = {}
1514
    self._processMap = {}
Line 1509... Line 1543...
1509
    self._processMap["markOrdersAsFailed"] = Processor.process_markOrdersAsFailed
1543
    self._processMap["markOrdersAsFailed"] = Processor.process_markOrdersAsFailed
1510
    self._processMap["updateNonDeliveryReason"] = Processor.process_updateNonDeliveryReason
1544
    self._processMap["updateNonDeliveryReason"] = Processor.process_updateNonDeliveryReason
1511
    self._processMap["getUndeliveredOrders"] = Processor.process_getUndeliveredOrders
1545
    self._processMap["getUndeliveredOrders"] = Processor.process_getUndeliveredOrders
1512
    self._processMap["getAlerts"] = Processor.process_getAlerts
1546
    self._processMap["getAlerts"] = Processor.process_getAlerts
1513
    self._processMap["setAlert"] = Processor.process_setAlert
1547
    self._processMap["setAlert"] = Processor.process_setAlert
-
 
1548
    self._processMap["getValidOrderCount"] = Processor.process_getValidOrderCount
1514
 
1549
 
1515
  def process(self, iprot, oprot):
1550
  def process(self, iprot, oprot):
1516
    (name, type, seqid) = iprot.readMessageBegin()
1551
    (name, type, seqid) = iprot.readMessageBegin()
1517
    if name not in self._processMap:
1552
    if name not in self._processMap:
1518
      iprot.skip(TType.STRUCT)
1553
      iprot.skip(TType.STRUCT)
Line 1975... Line 2010...
1975
    oprot.writeMessageBegin("setAlert", TMessageType.REPLY, seqid)
2010
    oprot.writeMessageBegin("setAlert", TMessageType.REPLY, seqid)
1976
    result.write(oprot)
2011
    result.write(oprot)
1977
    oprot.writeMessageEnd()
2012
    oprot.writeMessageEnd()
1978
    oprot.trans.flush()
2013
    oprot.trans.flush()
1979
 
2014
 
-
 
2015
  def process_getValidOrderCount(self, seqid, iprot, oprot):
-
 
2016
    args = getValidOrderCount_args()
-
 
2017
    args.read(iprot)
-
 
2018
    iprot.readMessageEnd()
-
 
2019
    result = getValidOrderCount_result()
-
 
2020
    result.success = self._handler.getValidOrderCount()
-
 
2021
    oprot.writeMessageBegin("getValidOrderCount", TMessageType.REPLY, seqid)
-
 
2022
    result.write(oprot)
-
 
2023
    oprot.writeMessageEnd()
-
 
2024
    oprot.trans.flush()
-
 
2025
 
1980
 
2026
 
1981
# HELPER FUNCTIONS AND STRUCTURES
2027
# HELPER FUNCTIONS AND STRUCTURES
1982
 
2028
 
1983
class closeSession_args:
2029
class closeSession_args:
1984
 
2030
 
Line 6480... Line 6526...
6480
    oprot.writeFieldStop()
6526
    oprot.writeFieldStop()
6481
    oprot.writeStructEnd()
6527
    oprot.writeStructEnd()
6482
 
6528
 
6483
  def __repr__(self):
6529
  def __repr__(self):
6484
    L = ['%s=%r' % (key, value)
6530
    L = ['%s=%r' % (key, value)
-
 
6531
      for key, value in self.__dict__.iteritems()]
-
 
6532
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
6533
 
-
 
6534
  def __eq__(self, other):
-
 
6535
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
6536
 
-
 
6537
  def __ne__(self, other):
-
 
6538
    return not (self == other)
-
 
6539
 
-
 
6540
class getValidOrderCount_args:
-
 
6541
 
-
 
6542
  thrift_spec = (
-
 
6543
  )
-
 
6544
 
-
 
6545
  def read(self, iprot):
-
 
6546
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
6547
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
6548
      return
-
 
6549
    iprot.readStructBegin()
-
 
6550
    while True:
-
 
6551
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
6552
      if ftype == TType.STOP:
-
 
6553
        break
-
 
6554
      else:
-
 
6555
        iprot.skip(ftype)
-
 
6556
      iprot.readFieldEnd()
-
 
6557
    iprot.readStructEnd()
-
 
6558
 
-
 
6559
  def write(self, oprot):
-
 
6560
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
6561
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
6562
      return
-
 
6563
    oprot.writeStructBegin('getValidOrderCount_args')
-
 
6564
    oprot.writeFieldStop()
-
 
6565
    oprot.writeStructEnd()
-
 
6566
 
-
 
6567
  def __repr__(self):
-
 
6568
    L = ['%s=%r' % (key, value)
-
 
6569
      for key, value in self.__dict__.iteritems()]
-
 
6570
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
6571
 
-
 
6572
  def __eq__(self, other):
-
 
6573
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
6574
 
-
 
6575
  def __ne__(self, other):
-
 
6576
    return not (self == other)
-
 
6577
 
-
 
6578
class getValidOrderCount_result:
-
 
6579
  """
-
 
6580
  Attributes:
-
 
6581
   - success
-
 
6582
  """
-
 
6583
 
-
 
6584
  thrift_spec = (
-
 
6585
    (0, TType.I64, 'success', None, None, ), # 0
-
 
6586
  )
-
 
6587
 
-
 
6588
  def __init__(self, success=None,):
-
 
6589
    self.success = success
-
 
6590
 
-
 
6591
  def read(self, iprot):
-
 
6592
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
6593
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
6594
      return
-
 
6595
    iprot.readStructBegin()
-
 
6596
    while True:
-
 
6597
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
6598
      if ftype == TType.STOP:
-
 
6599
        break
-
 
6600
      if fid == 0:
-
 
6601
        if ftype == TType.I64:
-
 
6602
          self.success = iprot.readI64();
-
 
6603
        else:
-
 
6604
          iprot.skip(ftype)
-
 
6605
      else:
-
 
6606
        iprot.skip(ftype)
-
 
6607
      iprot.readFieldEnd()
-
 
6608
    iprot.readStructEnd()
-
 
6609
 
-
 
6610
  def write(self, oprot):
-
 
6611
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
6612
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
6613
      return
-
 
6614
    oprot.writeStructBegin('getValidOrderCount_result')
-
 
6615
    if self.success != None:
-
 
6616
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
6617
      oprot.writeI64(self.success)
-
 
6618
      oprot.writeFieldEnd()
-
 
6619
    oprot.writeFieldStop()
-
 
6620
    oprot.writeStructEnd()
-
 
6621
 
-
 
6622
  def __repr__(self):
-
 
6623
    L = ['%s=%r' % (key, value)
6485
      for key, value in self.__dict__.iteritems()]
6624
      for key, value in self.__dict__.iteritems()]
6486
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
6625
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
6487
 
6626
 
6488
  def __eq__(self, other):
6627
  def __eq__(self, other):
6489
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
6628
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__