Subversion Repositories SmartDukaan

Rev

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

Rev 1137 Rev 1730
Line 96... Line 96...
96
    Parameters:
96
    Parameters:
97
     - providerId
97
     - providerId
98
    """
98
    """
99
    pass
99
    pass
100
 
100
 
-
 
101
  def getHolidays(self, fromDate, toDate):
-
 
102
    """
-
 
103
    Returns list of Holiday dates between fromDate and toDate (both inclusive)
-
 
104
    fromDate should be passed as milliseconds corresponding to the start of the day.
-
 
105
    If fromDate is passed as -1, fromDate is not considered for filtering
-
 
106
    If toDate is passed as -1, toDate is not considered for filtering
-
 
107
    
-
 
108
    Parameters:
-
 
109
     - fromDate
-
 
110
     - toDate
-
 
111
    """
-
 
112
    pass
-
 
113
 
101
 
114
 
102
class Client(Iface):
115
class Client(Iface):
103
  def __init__(self, iprot, oprot=None):
116
  def __init__(self, iprot, oprot=None):
104
    self._iprot = self._oprot = iprot
117
    self._iprot = self._oprot = iprot
105
    if oprot != None:
118
    if oprot != None:
Line 407... Line 420...
407
    self._iprot.readMessageEnd()
420
    self._iprot.readMessageEnd()
408
    if result.success != None:
421
    if result.success != None:
409
      return result.success
422
      return result.success
410
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getFreeAwbCount failed: unknown result");
423
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getFreeAwbCount failed: unknown result");
411
 
424
 
-
 
425
  def getHolidays(self, fromDate, toDate):
-
 
426
    """
-
 
427
    Returns list of Holiday dates between fromDate and toDate (both inclusive)
-
 
428
    fromDate should be passed as milliseconds corresponding to the start of the day.
-
 
429
    If fromDate is passed as -1, fromDate is not considered for filtering
-
 
430
    If toDate is passed as -1, toDate is not considered for filtering
-
 
431
    
-
 
432
    Parameters:
-
 
433
     - fromDate
-
 
434
     - toDate
-
 
435
    """
-
 
436
    self.send_getHolidays(fromDate, toDate)
-
 
437
    return self.recv_getHolidays()
-
 
438
 
-
 
439
  def send_getHolidays(self, fromDate, toDate):
-
 
440
    self._oprot.writeMessageBegin('getHolidays', TMessageType.CALL, self._seqid)
-
 
441
    args = getHolidays_args()
-
 
442
    args.fromDate = fromDate
-
 
443
    args.toDate = toDate
-
 
444
    args.write(self._oprot)
-
 
445
    self._oprot.writeMessageEnd()
-
 
446
    self._oprot.trans.flush()
-
 
447
 
-
 
448
  def recv_getHolidays(self, ):
-
 
449
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
450
    if mtype == TMessageType.EXCEPTION:
-
 
451
      x = TApplicationException()
-
 
452
      x.read(self._iprot)
-
 
453
      self._iprot.readMessageEnd()
-
 
454
      raise x
-
 
455
    result = getHolidays_result()
-
 
456
    result.read(self._iprot)
-
 
457
    self._iprot.readMessageEnd()
-
 
458
    if result.success != None:
-
 
459
      return result.success
-
 
460
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHolidays failed: unknown result");
-
 
461
 
412
 
462
 
413
class Processor(Iface, TProcessor):
463
class Processor(Iface, TProcessor):
414
  def __init__(self, handler):
464
  def __init__(self, handler):
415
    self._handler = handler
465
    self._handler = handler
416
    self._processMap = {}
466
    self._processMap = {}
Line 421... Line 471...
421
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
471
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
422
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
472
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
423
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
473
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
424
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
474
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
425
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
475
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
-
 
476
    self._processMap["getHolidays"] = Processor.process_getHolidays
426
 
477
 
427
  def process(self, iprot, oprot):
478
  def process(self, iprot, oprot):
428
    (name, type, seqid) = iprot.readMessageBegin()
479
    (name, type, seqid) = iprot.readMessageBegin()
429
    if name not in self._processMap:
480
    if name not in self._processMap:
430
      iprot.skip(TType.STRUCT)
481
      iprot.skip(TType.STRUCT)
Line 557... Line 608...
557
    oprot.writeMessageBegin("getFreeAwbCount", TMessageType.REPLY, seqid)
608
    oprot.writeMessageBegin("getFreeAwbCount", TMessageType.REPLY, seqid)
558
    result.write(oprot)
609
    result.write(oprot)
559
    oprot.writeMessageEnd()
610
    oprot.writeMessageEnd()
560
    oprot.trans.flush()
611
    oprot.trans.flush()
561
 
612
 
-
 
613
  def process_getHolidays(self, seqid, iprot, oprot):
-
 
614
    args = getHolidays_args()
-
 
615
    args.read(iprot)
-
 
616
    iprot.readMessageEnd()
-
 
617
    result = getHolidays_result()
-
 
618
    result.success = self._handler.getHolidays(args.fromDate, args.toDate)
-
 
619
    oprot.writeMessageBegin("getHolidays", TMessageType.REPLY, seqid)
-
 
620
    result.write(oprot)
-
 
621
    oprot.writeMessageEnd()
-
 
622
    oprot.trans.flush()
-
 
623
 
562
 
624
 
563
# HELPER FUNCTIONS AND STRUCTURES
625
# HELPER FUNCTIONS AND STRUCTURES
564
 
626
 
565
class closeSession_args:
627
class closeSession_args:
566
 
628
 
Line 1656... Line 1718...
1656
      oprot.writeFieldEnd()
1718
      oprot.writeFieldEnd()
1657
    oprot.writeFieldStop()
1719
    oprot.writeFieldStop()
1658
    oprot.writeStructEnd()
1720
    oprot.writeStructEnd()
1659
 
1721
 
1660
  def __repr__(self):
1722
  def __repr__(self):
-
 
1723
    L = ['%s=%r' % (key, value)
-
 
1724
      for key, value in self.__dict__.iteritems()]
-
 
1725
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1726
 
-
 
1727
  def __eq__(self, other):
-
 
1728
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1729
 
-
 
1730
  def __ne__(self, other):
-
 
1731
    return not (self == other)
-
 
1732
 
-
 
1733
class getHolidays_args:
-
 
1734
  """
-
 
1735
  Attributes:
-
 
1736
   - fromDate
-
 
1737
   - toDate
-
 
1738
  """
-
 
1739
 
-
 
1740
  thrift_spec = (
-
 
1741
    None, # 0
-
 
1742
    (1, TType.I64, 'fromDate', None, None, ), # 1
-
 
1743
    (2, TType.I64, 'toDate', None, None, ), # 2
-
 
1744
  )
-
 
1745
 
-
 
1746
  def __init__(self, fromDate=None, toDate=None,):
-
 
1747
    self.fromDate = fromDate
-
 
1748
    self.toDate = toDate
-
 
1749
 
-
 
1750
  def read(self, iprot):
-
 
1751
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1752
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1753
      return
-
 
1754
    iprot.readStructBegin()
-
 
1755
    while True:
-
 
1756
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1757
      if ftype == TType.STOP:
-
 
1758
        break
-
 
1759
      if fid == 1:
-
 
1760
        if ftype == TType.I64:
-
 
1761
          self.fromDate = iprot.readI64();
-
 
1762
        else:
-
 
1763
          iprot.skip(ftype)
-
 
1764
      elif fid == 2:
-
 
1765
        if ftype == TType.I64:
-
 
1766
          self.toDate = iprot.readI64();
-
 
1767
        else:
-
 
1768
          iprot.skip(ftype)
-
 
1769
      else:
-
 
1770
        iprot.skip(ftype)
-
 
1771
      iprot.readFieldEnd()
-
 
1772
    iprot.readStructEnd()
-
 
1773
 
-
 
1774
  def write(self, oprot):
-
 
1775
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1776
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1777
      return
-
 
1778
    oprot.writeStructBegin('getHolidays_args')
-
 
1779
    if self.fromDate != None:
-
 
1780
      oprot.writeFieldBegin('fromDate', TType.I64, 1)
-
 
1781
      oprot.writeI64(self.fromDate)
-
 
1782
      oprot.writeFieldEnd()
-
 
1783
    if self.toDate != None:
-
 
1784
      oprot.writeFieldBegin('toDate', TType.I64, 2)
-
 
1785
      oprot.writeI64(self.toDate)
-
 
1786
      oprot.writeFieldEnd()
-
 
1787
    oprot.writeFieldStop()
-
 
1788
    oprot.writeStructEnd()
-
 
1789
 
-
 
1790
  def __repr__(self):
-
 
1791
    L = ['%s=%r' % (key, value)
-
 
1792
      for key, value in self.__dict__.iteritems()]
-
 
1793
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1794
 
-
 
1795
  def __eq__(self, other):
-
 
1796
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1797
 
-
 
1798
  def __ne__(self, other):
-
 
1799
    return not (self == other)
-
 
1800
 
-
 
1801
class getHolidays_result:
-
 
1802
  """
-
 
1803
  Attributes:
-
 
1804
   - success
-
 
1805
  """
-
 
1806
 
-
 
1807
  thrift_spec = (
-
 
1808
    (0, TType.LIST, 'success', (TType.I64,None), None, ), # 0
-
 
1809
  )
-
 
1810
 
-
 
1811
  def __init__(self, success=None,):
-
 
1812
    self.success = success
-
 
1813
 
-
 
1814
  def read(self, iprot):
-
 
1815
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1816
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1817
      return
-
 
1818
    iprot.readStructBegin()
-
 
1819
    while True:
-
 
1820
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1821
      if ftype == TType.STOP:
-
 
1822
        break
-
 
1823
      if fid == 0:
-
 
1824
        if ftype == TType.LIST:
-
 
1825
          self.success = []
-
 
1826
          (_etype17, _size14) = iprot.readListBegin()
-
 
1827
          for _i18 in xrange(_size14):
-
 
1828
            _elem19 = iprot.readI64();
-
 
1829
            self.success.append(_elem19)
-
 
1830
          iprot.readListEnd()
-
 
1831
        else:
-
 
1832
          iprot.skip(ftype)
-
 
1833
      else:
-
 
1834
        iprot.skip(ftype)
-
 
1835
      iprot.readFieldEnd()
-
 
1836
    iprot.readStructEnd()
-
 
1837
 
-
 
1838
  def write(self, oprot):
-
 
1839
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1840
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1841
      return
-
 
1842
    oprot.writeStructBegin('getHolidays_result')
-
 
1843
    if self.success != None:
-
 
1844
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
1845
      oprot.writeListBegin(TType.I64, len(self.success))
-
 
1846
      for iter20 in self.success:
-
 
1847
        oprot.writeI64(iter20)
-
 
1848
      oprot.writeListEnd()
-
 
1849
      oprot.writeFieldEnd()
-
 
1850
    oprot.writeFieldStop()
-
 
1851
    oprot.writeStructEnd()
-
 
1852
 
-
 
1853
  def __repr__(self):
1661
    L = ['%s=%r' % (key, value)
1854
    L = ['%s=%r' % (key, value)
1662
      for key, value in self.__dict__.iteritems()]
1855
      for key, value in self.__dict__.iteritems()]
1663
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1856
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1664
 
1857
 
1665
  def __eq__(self, other):
1858
  def __eq__(self, other):