Subversion Repositories SmartDukaan

Rev

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

Rev 6524 Rev 6643
Line 65... Line 65...
65
     - providerId
65
     - providerId
66
     - type
66
     - type
67
    """
67
    """
68
    pass
68
    pass
69
 
69
 
70
  def getShipmentInfo(self, awb, providerId):
70
  def getShipmentInfo(self, awbNumber, providerId):
71
    """
71
    """
72
    Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
72
    Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
73
 
73
 
74
    Parameters:
74
    Parameters:
75
     - awb
75
     - awbNumber
76
     - providerId
76
     - providerId
77
    """
77
    """
78
    pass
78
    pass
79
 
79
 
-
 
80
  def storeShipmentInfo(self, update):
-
 
81
    """
-
 
82
    Store the update for the given AWB number and provider id.
-
 
83
 
-
 
84
    Parameters:
-
 
85
     - update
-
 
86
    """
-
 
87
    pass
-
 
88
 
80
  def getDestinationCode(self, providerId, pinCode):
89
  def getDestinationCode(self, providerId, pinCode):
81
    """
90
    """
82
    Returns the short three letter code of a pincode for the given provider.
91
    Returns the short three letter code of a pincode for the given provider.
83
       Raises an exception if the pin code is not serviced by the given provider.
92
       Raises an exception if the pin code is not serviced by the given provider.
84
 
93
 
Line 357... Line 366...
357
      return result.success
366
      return result.success
358
    if result.se is not None:
367
    if result.se is not None:
359
      raise result.se
368
      raise result.se
360
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getEmptyAWB failed: unknown result");
369
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getEmptyAWB failed: unknown result");
361
 
370
 
362
  def getShipmentInfo(self, awb, providerId):
371
  def getShipmentInfo(self, awbNumber, providerId):
363
    """
372
    """
364
    Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
373
    Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.
365
 
374
 
366
    Parameters:
375
    Parameters:
367
     - awb
376
     - awbNumber
368
     - providerId
377
     - providerId
369
    """
378
    """
370
    self.send_getShipmentInfo(awb, providerId)
379
    self.send_getShipmentInfo(awbNumber, providerId)
371
    return self.recv_getShipmentInfo()
380
    return self.recv_getShipmentInfo()
372
 
381
 
373
  def send_getShipmentInfo(self, awb, providerId):
382
  def send_getShipmentInfo(self, awbNumber, providerId):
374
    self._oprot.writeMessageBegin('getShipmentInfo', TMessageType.CALL, self._seqid)
383
    self._oprot.writeMessageBegin('getShipmentInfo', TMessageType.CALL, self._seqid)
375
    args = getShipmentInfo_args()
384
    args = getShipmentInfo_args()
376
    args.awb = awb
385
    args.awbNumber = awbNumber
377
    args.providerId = providerId
386
    args.providerId = providerId
378
    args.write(self._oprot)
387
    args.write(self._oprot)
379
    self._oprot.writeMessageEnd()
388
    self._oprot.writeMessageEnd()
380
    self._oprot.trans.flush()
389
    self._oprot.trans.flush()
381
 
390
 
Line 393... Line 402...
393
      return result.success
402
      return result.success
394
    if result.se is not None:
403
    if result.se is not None:
395
      raise result.se
404
      raise result.se
396
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getShipmentInfo failed: unknown result");
405
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getShipmentInfo failed: unknown result");
397
 
406
 
-
 
407
  def storeShipmentInfo(self, update):
-
 
408
    """
-
 
409
    Store the update for the given AWB number and provider id.
-
 
410
 
-
 
411
    Parameters:
-
 
412
     - update
-
 
413
    """
-
 
414
    self.send_storeShipmentInfo(update)
-
 
415
    self.recv_storeShipmentInfo()
-
 
416
 
-
 
417
  def send_storeShipmentInfo(self, update):
-
 
418
    self._oprot.writeMessageBegin('storeShipmentInfo', TMessageType.CALL, self._seqid)
-
 
419
    args = storeShipmentInfo_args()
-
 
420
    args.update = update
-
 
421
    args.write(self._oprot)
-
 
422
    self._oprot.writeMessageEnd()
-
 
423
    self._oprot.trans.flush()
-
 
424
 
-
 
425
  def recv_storeShipmentInfo(self, ):
-
 
426
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
427
    if mtype == TMessageType.EXCEPTION:
-
 
428
      x = TApplicationException()
-
 
429
      x.read(self._iprot)
-
 
430
      self._iprot.readMessageEnd()
-
 
431
      raise x
-
 
432
    result = storeShipmentInfo_result()
-
 
433
    result.read(self._iprot)
-
 
434
    self._iprot.readMessageEnd()
-
 
435
    if result.se is not None:
-
 
436
      raise result.se
-
 
437
    return
-
 
438
 
398
  def getDestinationCode(self, providerId, pinCode):
439
  def getDestinationCode(self, providerId, pinCode):
399
    """
440
    """
400
    Returns the short three letter code of a pincode for the given provider.
441
    Returns the short three letter code of a pincode for the given provider.
401
       Raises an exception if the pin code is not serviced by the given provider.
442
       Raises an exception if the pin code is not serviced by the given provider.
402
 
443
 
Line 744... Line 785...
744
    self._processMap["getAllProviders"] = Processor.process_getAllProviders
785
    self._processMap["getAllProviders"] = Processor.process_getAllProviders
745
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
786
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
746
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
787
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
747
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
788
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
748
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
789
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
-
 
790
    self._processMap["storeShipmentInfo"] = Processor.process_storeShipmentInfo
749
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
791
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
750
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
792
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
751
    self._processMap["getHolidays"] = Processor.process_getHolidays
793
    self._processMap["getHolidays"] = Processor.process_getHolidays
752
    self._processMap["getEntityLogisticsEstimation"] = Processor.process_getEntityLogisticsEstimation
794
    self._processMap["getEntityLogisticsEstimation"] = Processor.process_getEntityLogisticsEstimation
753
    self._processMap["getProviderForPickupType"] = Processor.process_getProviderForPickupType
795
    self._processMap["getProviderForPickupType"] = Processor.process_getProviderForPickupType
Line 846... Line 888...
846
    args = getShipmentInfo_args()
888
    args = getShipmentInfo_args()
847
    args.read(iprot)
889
    args.read(iprot)
848
    iprot.readMessageEnd()
890
    iprot.readMessageEnd()
849
    result = getShipmentInfo_result()
891
    result = getShipmentInfo_result()
850
    try:
892
    try:
851
      result.success = self._handler.getShipmentInfo(args.awb, args.providerId)
893
      result.success = self._handler.getShipmentInfo(args.awbNumber, args.providerId)
852
    except LogisticsServiceException, se:
894
    except LogisticsServiceException, se:
853
      result.se = se
895
      result.se = se
854
    oprot.writeMessageBegin("getShipmentInfo", TMessageType.REPLY, seqid)
896
    oprot.writeMessageBegin("getShipmentInfo", TMessageType.REPLY, seqid)
855
    result.write(oprot)
897
    result.write(oprot)
856
    oprot.writeMessageEnd()
898
    oprot.writeMessageEnd()
857
    oprot.trans.flush()
899
    oprot.trans.flush()
858
 
900
 
-
 
901
  def process_storeShipmentInfo(self, seqid, iprot, oprot):
-
 
902
    args = storeShipmentInfo_args()
-
 
903
    args.read(iprot)
-
 
904
    iprot.readMessageEnd()
-
 
905
    result = storeShipmentInfo_result()
-
 
906
    try:
-
 
907
      self._handler.storeShipmentInfo(args.update)
-
 
908
    except LogisticsServiceException, se:
-
 
909
      result.se = se
-
 
910
    oprot.writeMessageBegin("storeShipmentInfo", TMessageType.REPLY, seqid)
-
 
911
    result.write(oprot)
-
 
912
    oprot.writeMessageEnd()
-
 
913
    oprot.trans.flush()
-
 
914
 
859
  def process_getDestinationCode(self, seqid, iprot, oprot):
915
  def process_getDestinationCode(self, seqid, iprot, oprot):
860
    args = getDestinationCode_args()
916
    args = getDestinationCode_args()
861
    args.read(iprot)
917
    args.read(iprot)
862
    iprot.readMessageEnd()
918
    iprot.readMessageEnd()
863
    result = getDestinationCode_result()
919
    result = getDestinationCode_result()
Line 1697... Line 1753...
1697
    return not (self == other)
1753
    return not (self == other)
1698
 
1754
 
1699
class getShipmentInfo_args:
1755
class getShipmentInfo_args:
1700
  """
1756
  """
1701
  Attributes:
1757
  Attributes:
1702
   - awb
1758
   - awbNumber
1703
   - providerId
1759
   - providerId
1704
  """
1760
  """
1705
 
1761
 
1706
  thrift_spec = (
1762
  thrift_spec = (
1707
    None, # 0
1763
    None, # 0
1708
    (1, TType.STRING, 'awb', None, None, ), # 1
1764
    (1, TType.STRING, 'awbNumber', None, None, ), # 1
1709
    (2, TType.I64, 'providerId', None, None, ), # 2
1765
    (2, TType.I64, 'providerId', None, None, ), # 2
1710
  )
1766
  )
1711
 
1767
 
1712
  def __init__(self, awb=None, providerId=None,):
1768
  def __init__(self, awbNumber=None, providerId=None,):
1713
    self.awb = awb
1769
    self.awbNumber = awbNumber
1714
    self.providerId = providerId
1770
    self.providerId = providerId
1715
 
1771
 
1716
  def read(self, iprot):
1772
  def read(self, iprot):
1717
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1773
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1718
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1774
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 1722... Line 1778...
1722
      (fname, ftype, fid) = iprot.readFieldBegin()
1778
      (fname, ftype, fid) = iprot.readFieldBegin()
1723
      if ftype == TType.STOP:
1779
      if ftype == TType.STOP:
1724
        break
1780
        break
1725
      if fid == 1:
1781
      if fid == 1:
1726
        if ftype == TType.STRING:
1782
        if ftype == TType.STRING:
1727
          self.awb = iprot.readString();
1783
          self.awbNumber = iprot.readString();
1728
        else:
1784
        else:
1729
          iprot.skip(ftype)
1785
          iprot.skip(ftype)
1730
      elif fid == 2:
1786
      elif fid == 2:
1731
        if ftype == TType.I64:
1787
        if ftype == TType.I64:
1732
          self.providerId = iprot.readI64();
1788
          self.providerId = iprot.readI64();
Line 1740... Line 1796...
1740
  def write(self, oprot):
1796
  def write(self, oprot):
1741
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1797
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1742
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1798
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1743
      return
1799
      return
1744
    oprot.writeStructBegin('getShipmentInfo_args')
1800
    oprot.writeStructBegin('getShipmentInfo_args')
1745
    if self.awb is not None:
1801
    if self.awbNumber is not None:
1746
      oprot.writeFieldBegin('awb', TType.STRING, 1)
1802
      oprot.writeFieldBegin('awbNumber', TType.STRING, 1)
1747
      oprot.writeString(self.awb)
1803
      oprot.writeString(self.awbNumber)
1748
      oprot.writeFieldEnd()
1804
      oprot.writeFieldEnd()
1749
    if self.providerId is not None:
1805
    if self.providerId is not None:
1750
      oprot.writeFieldBegin('providerId', TType.I64, 2)
1806
      oprot.writeFieldBegin('providerId', TType.I64, 2)
1751
      oprot.writeI64(self.providerId)
1807
      oprot.writeI64(self.providerId)
1752
      oprot.writeFieldEnd()
1808
      oprot.writeFieldEnd()
Line 1830... Line 1886...
1830
    if self.se is not None:
1886
    if self.se is not None:
1831
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1887
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1832
      self.se.write(oprot)
1888
      self.se.write(oprot)
1833
      oprot.writeFieldEnd()
1889
      oprot.writeFieldEnd()
1834
    oprot.writeFieldStop()
1890
    oprot.writeFieldStop()
-
 
1891
    oprot.writeStructEnd()
-
 
1892
 
-
 
1893
  def validate(self):
-
 
1894
    return
-
 
1895
 
-
 
1896
 
-
 
1897
  def __repr__(self):
-
 
1898
    L = ['%s=%r' % (key, value)
-
 
1899
      for key, value in self.__dict__.iteritems()]
-
 
1900
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1901
 
-
 
1902
  def __eq__(self, other):
-
 
1903
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1904
 
-
 
1905
  def __ne__(self, other):
-
 
1906
    return not (self == other)
-
 
1907
 
-
 
1908
class storeShipmentInfo_args:
-
 
1909
  """
-
 
1910
  Attributes:
-
 
1911
   - update
-
 
1912
  """
-
 
1913
 
-
 
1914
  thrift_spec = (
-
 
1915
    None, # 0
-
 
1916
    (1, TType.STRUCT, 'update', (AwbUpdate, AwbUpdate.thrift_spec), None, ), # 1
-
 
1917
  )
-
 
1918
 
-
 
1919
  def __init__(self, update=None,):
-
 
1920
    self.update = update
-
 
1921
 
-
 
1922
  def read(self, iprot):
-
 
1923
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1924
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1925
      return
-
 
1926
    iprot.readStructBegin()
-
 
1927
    while True:
-
 
1928
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1929
      if ftype == TType.STOP:
-
 
1930
        break
-
 
1931
      if fid == 1:
-
 
1932
        if ftype == TType.STRUCT:
-
 
1933
          self.update = AwbUpdate()
-
 
1934
          self.update.read(iprot)
-
 
1935
        else:
-
 
1936
          iprot.skip(ftype)
-
 
1937
      else:
-
 
1938
        iprot.skip(ftype)
-
 
1939
      iprot.readFieldEnd()
-
 
1940
    iprot.readStructEnd()
-
 
1941
 
-
 
1942
  def write(self, oprot):
-
 
1943
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1944
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1945
      return
-
 
1946
    oprot.writeStructBegin('storeShipmentInfo_args')
-
 
1947
    if self.update is not None:
-
 
1948
      oprot.writeFieldBegin('update', TType.STRUCT, 1)
-
 
1949
      self.update.write(oprot)
-
 
1950
      oprot.writeFieldEnd()
-
 
1951
    oprot.writeFieldStop()
-
 
1952
    oprot.writeStructEnd()
-
 
1953
 
-
 
1954
  def validate(self):
-
 
1955
    return
-
 
1956
 
-
 
1957
 
-
 
1958
  def __repr__(self):
-
 
1959
    L = ['%s=%r' % (key, value)
-
 
1960
      for key, value in self.__dict__.iteritems()]
-
 
1961
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1962
 
-
 
1963
  def __eq__(self, other):
-
 
1964
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1965
 
-
 
1966
  def __ne__(self, other):
-
 
1967
    return not (self == other)
-
 
1968
 
-
 
1969
class storeShipmentInfo_result:
-
 
1970
  """
-
 
1971
  Attributes:
-
 
1972
   - se
-
 
1973
  """
-
 
1974
 
-
 
1975
  thrift_spec = (
-
 
1976
    None, # 0
-
 
1977
    (1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1
-
 
1978
  )
-
 
1979
 
-
 
1980
  def __init__(self, se=None,):
-
 
1981
    self.se = se
-
 
1982
 
-
 
1983
  def read(self, iprot):
-
 
1984
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1985
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1986
      return
-
 
1987
    iprot.readStructBegin()
-
 
1988
    while True:
-
 
1989
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1990
      if ftype == TType.STOP:
-
 
1991
        break
-
 
1992
      if fid == 1:
-
 
1993
        if ftype == TType.STRUCT:
-
 
1994
          self.se = LogisticsServiceException()
-
 
1995
          self.se.read(iprot)
-
 
1996
        else:
-
 
1997
          iprot.skip(ftype)
-
 
1998
      else:
-
 
1999
        iprot.skip(ftype)
-
 
2000
      iprot.readFieldEnd()
-
 
2001
    iprot.readStructEnd()
-
 
2002
 
-
 
2003
  def write(self, oprot):
-
 
2004
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2005
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2006
      return
-
 
2007
    oprot.writeStructBegin('storeShipmentInfo_result')
-
 
2008
    if self.se is not None:
-
 
2009
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
-
 
2010
      self.se.write(oprot)
-
 
2011
      oprot.writeFieldEnd()
-
 
2012
    oprot.writeFieldStop()
1835
    oprot.writeStructEnd()
2013
    oprot.writeStructEnd()
1836
 
2014
 
1837
  def validate(self):
2015
  def validate(self):
1838
    return
2016
    return
1839
 
2017