Subversion Repositories SmartDukaan

Rev

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

Rev 1730 Rev 3044
Line 47... Line 47...
47
     - itemId
47
     - itemId
48
     - destination_pin
48
     - destination_pin
49
    """
49
    """
50
    pass
50
    pass
51
 
51
 
52
  def getLogisticsInfo(self, destination_pincode, item_id):
52
  def getLogisticsInfo(self, destination_pincode, item_id, type):
53
    """
53
    """
54
    Same as above excpet that an airway bill number is also allocated and returned.
54
    Same as above excpet that an airway bill number is also allocated and returned.
55
    
55
    
56
    Parameters:
56
    Parameters:
57
     - destination_pincode
57
     - destination_pincode
58
     - item_id
58
     - item_id
-
 
59
     - type
59
    """
60
    """
60
    pass
61
    pass
61
 
62
 
62
  def getEmptyAWB(self, providerId):
63
  def getEmptyAWB(self, providerId):
63
    """
64
    """
Line 245... Line 246...
245
      return result.success
246
      return result.success
246
    if result.se != None:
247
    if result.se != None:
247
      raise result.se
248
      raise result.se
248
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");
249
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");
249
 
250
 
250
  def getLogisticsInfo(self, destination_pincode, item_id):
251
  def getLogisticsInfo(self, destination_pincode, item_id, type):
251
    """
252
    """
252
    Same as above excpet that an airway bill number is also allocated and returned.
253
    Same as above excpet that an airway bill number is also allocated and returned.
253
    
254
    
254
    Parameters:
255
    Parameters:
255
     - destination_pincode
256
     - destination_pincode
256
     - item_id
257
     - item_id
-
 
258
     - type
257
    """
259
    """
258
    self.send_getLogisticsInfo(destination_pincode, item_id)
260
    self.send_getLogisticsInfo(destination_pincode, item_id, type)
259
    return self.recv_getLogisticsInfo()
261
    return self.recv_getLogisticsInfo()
260
 
262
 
261
  def send_getLogisticsInfo(self, destination_pincode, item_id):
263
  def send_getLogisticsInfo(self, destination_pincode, item_id, type):
262
    self._oprot.writeMessageBegin('getLogisticsInfo', TMessageType.CALL, self._seqid)
264
    self._oprot.writeMessageBegin('getLogisticsInfo', TMessageType.CALL, self._seqid)
263
    args = getLogisticsInfo_args()
265
    args = getLogisticsInfo_args()
264
    args.destination_pincode = destination_pincode
266
    args.destination_pincode = destination_pincode
265
    args.item_id = item_id
267
    args.item_id = item_id
-
 
268
    args.type = type
266
    args.write(self._oprot)
269
    args.write(self._oprot)
267
    self._oprot.writeMessageEnd()
270
    self._oprot.writeMessageEnd()
268
    self._oprot.trans.flush()
271
    self._oprot.trans.flush()
269
 
272
 
270
  def recv_getLogisticsInfo(self, ):
273
  def recv_getLogisticsInfo(self, ):
Line 547... Line 550...
547
    args = getLogisticsInfo_args()
550
    args = getLogisticsInfo_args()
548
    args.read(iprot)
551
    args.read(iprot)
549
    iprot.readMessageEnd()
552
    iprot.readMessageEnd()
550
    result = getLogisticsInfo_result()
553
    result = getLogisticsInfo_result()
551
    try:
554
    try:
552
      result.success = self._handler.getLogisticsInfo(args.destination_pincode, args.item_id)
555
      result.success = self._handler.getLogisticsInfo(args.destination_pincode, args.item_id, args.type)
553
    except LogisticsServiceException, se:
556
    except LogisticsServiceException, se:
554
      result.se = se
557
      result.se = se
555
    oprot.writeMessageBegin("getLogisticsInfo", TMessageType.REPLY, seqid)
558
    oprot.writeMessageBegin("getLogisticsInfo", TMessageType.REPLY, seqid)
556
    result.write(oprot)
559
    result.write(oprot)
557
    oprot.writeMessageEnd()
560
    oprot.writeMessageEnd()
Line 889... Line 892...
889
      if ftype == TType.STOP:
892
      if ftype == TType.STOP:
890
        break
893
        break
891
      if fid == 0:
894
      if fid == 0:
892
        if ftype == TType.LIST:
895
        if ftype == TType.LIST:
893
          self.success = []
896
          self.success = []
894
          (_etype3, _size0) = iprot.readListBegin()
897
          (_etype12, _size9) = iprot.readListBegin()
895
          for _i4 in xrange(_size0):
898
          for _i13 in xrange(_size9):
896
            _elem5 = Provider()
899
            _elem14 = Provider()
897
            _elem5.read(iprot)
900
            _elem14.read(iprot)
898
            self.success.append(_elem5)
901
            self.success.append(_elem14)
899
          iprot.readListEnd()
902
          iprot.readListEnd()
900
        else:
903
        else:
901
          iprot.skip(ftype)
904
          iprot.skip(ftype)
902
      elif fid == 1:
905
      elif fid == 1:
903
        if ftype == TType.STRUCT:
906
        if ftype == TType.STRUCT:
Line 916... Line 919...
916
      return
919
      return
917
    oprot.writeStructBegin('getAllProviders_result')
920
    oprot.writeStructBegin('getAllProviders_result')
918
    if self.success != None:
921
    if self.success != None:
919
      oprot.writeFieldBegin('success', TType.LIST, 0)
922
      oprot.writeFieldBegin('success', TType.LIST, 0)
920
      oprot.writeListBegin(TType.STRUCT, len(self.success))
923
      oprot.writeListBegin(TType.STRUCT, len(self.success))
921
      for iter6 in self.success:
924
      for iter15 in self.success:
922
        iter6.write(oprot)
925
        iter15.write(oprot)
923
      oprot.writeListEnd()
926
      oprot.writeListEnd()
924
      oprot.writeFieldEnd()
927
      oprot.writeFieldEnd()
925
    if self.lse != None:
928
    if self.lse != None:
926
      oprot.writeFieldBegin('lse', TType.STRUCT, 1)
929
      oprot.writeFieldBegin('lse', TType.STRUCT, 1)
927
      self.lse.write(oprot)
930
      self.lse.write(oprot)
Line 1080... Line 1083...
1080
class getLogisticsInfo_args:
1083
class getLogisticsInfo_args:
1081
  """
1084
  """
1082
  Attributes:
1085
  Attributes:
1083
   - destination_pincode
1086
   - destination_pincode
1084
   - item_id
1087
   - item_id
-
 
1088
   - type
1085
  """
1089
  """
1086
 
1090
 
1087
  thrift_spec = (
1091
  thrift_spec = (
1088
    None, # 0
1092
    None, # 0
1089
    (1, TType.STRING, 'destination_pincode', None, None, ), # 1
1093
    (1, TType.STRING, 'destination_pincode', None, None, ), # 1
1090
    (2, TType.I64, 'item_id', None, None, ), # 2
1094
    (2, TType.I64, 'item_id', None, None, ), # 2
-
 
1095
    (3, TType.I32, 'type', None, None, ), # 3
1091
  )
1096
  )
1092
 
1097
 
1093
  def __init__(self, destination_pincode=None, item_id=None,):
1098
  def __init__(self, destination_pincode=None, item_id=None, type=None,):
1094
    self.destination_pincode = destination_pincode
1099
    self.destination_pincode = destination_pincode
1095
    self.item_id = item_id
1100
    self.item_id = item_id
-
 
1101
    self.type = type
1096
 
1102
 
1097
  def read(self, iprot):
1103
  def read(self, iprot):
1098
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1104
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1099
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1105
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1100
      return
1106
      return
Line 1111... Line 1117...
1111
      elif fid == 2:
1117
      elif fid == 2:
1112
        if ftype == TType.I64:
1118
        if ftype == TType.I64:
1113
          self.item_id = iprot.readI64();
1119
          self.item_id = iprot.readI64();
1114
        else:
1120
        else:
1115
          iprot.skip(ftype)
1121
          iprot.skip(ftype)
-
 
1122
      elif fid == 3:
-
 
1123
        if ftype == TType.I32:
-
 
1124
          self.type = iprot.readI32();
-
 
1125
        else:
-
 
1126
          iprot.skip(ftype)
1116
      else:
1127
      else:
1117
        iprot.skip(ftype)
1128
        iprot.skip(ftype)
1118
      iprot.readFieldEnd()
1129
      iprot.readFieldEnd()
1119
    iprot.readStructEnd()
1130
    iprot.readStructEnd()
1120
 
1131
 
Line 1129... Line 1140...
1129
      oprot.writeFieldEnd()
1140
      oprot.writeFieldEnd()
1130
    if self.item_id != None:
1141
    if self.item_id != None:
1131
      oprot.writeFieldBegin('item_id', TType.I64, 2)
1142
      oprot.writeFieldBegin('item_id', TType.I64, 2)
1132
      oprot.writeI64(self.item_id)
1143
      oprot.writeI64(self.item_id)
1133
      oprot.writeFieldEnd()
1144
      oprot.writeFieldEnd()
-
 
1145
    if self.type != None:
-
 
1146
      oprot.writeFieldBegin('type', TType.I32, 3)
-
 
1147
      oprot.writeI32(self.type)
-
 
1148
      oprot.writeFieldEnd()
1134
    oprot.writeFieldStop()
1149
    oprot.writeFieldStop()
1135
    oprot.writeStructEnd()
1150
    oprot.writeStructEnd()
1136
 
1151
 
1137
  def __repr__(self):
1152
  def __repr__(self):
1138
    L = ['%s=%r' % (key, value)
1153
    L = ['%s=%r' % (key, value)
Line 1432... Line 1447...
1432
      if ftype == TType.STOP:
1447
      if ftype == TType.STOP:
1433
        break
1448
        break
1434
      if fid == 0:
1449
      if fid == 0:
1435
        if ftype == TType.LIST:
1450
        if ftype == TType.LIST:
1436
          self.success = []
1451
          self.success = []
1437
          (_etype10, _size7) = iprot.readListBegin()
1452
          (_etype19, _size16) = iprot.readListBegin()
1438
          for _i11 in xrange(_size7):
1453
          for _i20 in xrange(_size16):
1439
            _elem12 = AwbUpdate()
1454
            _elem21 = AwbUpdate()
1440
            _elem12.read(iprot)
1455
            _elem21.read(iprot)
1441
            self.success.append(_elem12)
1456
            self.success.append(_elem21)
1442
          iprot.readListEnd()
1457
          iprot.readListEnd()
1443
        else:
1458
        else:
1444
          iprot.skip(ftype)
1459
          iprot.skip(ftype)
1445
      elif fid == 1:
1460
      elif fid == 1:
1446
        if ftype == TType.STRUCT:
1461
        if ftype == TType.STRUCT:
Line 1459... Line 1474...
1459
      return
1474
      return
1460
    oprot.writeStructBegin('getShipmentInfo_result')
1475
    oprot.writeStructBegin('getShipmentInfo_result')
1461
    if self.success != None:
1476
    if self.success != None:
1462
      oprot.writeFieldBegin('success', TType.LIST, 0)
1477
      oprot.writeFieldBegin('success', TType.LIST, 0)
1463
      oprot.writeListBegin(TType.STRUCT, len(self.success))
1478
      oprot.writeListBegin(TType.STRUCT, len(self.success))
1464
      for iter13 in self.success:
1479
      for iter22 in self.success:
1465
        iter13.write(oprot)
1480
        iter22.write(oprot)
1466
      oprot.writeListEnd()
1481
      oprot.writeListEnd()
1467
      oprot.writeFieldEnd()
1482
      oprot.writeFieldEnd()
1468
    if self.se != None:
1483
    if self.se != None:
1469
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1484
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1470
      self.se.write(oprot)
1485
      self.se.write(oprot)
Line 1821... Line 1836...
1821
      if ftype == TType.STOP:
1836
      if ftype == TType.STOP:
1822
        break
1837
        break
1823
      if fid == 0:
1838
      if fid == 0:
1824
        if ftype == TType.LIST:
1839
        if ftype == TType.LIST:
1825
          self.success = []
1840
          self.success = []
1826
          (_etype17, _size14) = iprot.readListBegin()
1841
          (_etype26, _size23) = iprot.readListBegin()
1827
          for _i18 in xrange(_size14):
1842
          for _i27 in xrange(_size23):
1828
            _elem19 = iprot.readI64();
1843
            _elem28 = iprot.readI64();
1829
            self.success.append(_elem19)
1844
            self.success.append(_elem28)
1830
          iprot.readListEnd()
1845
          iprot.readListEnd()
1831
        else:
1846
        else:
1832
          iprot.skip(ftype)
1847
          iprot.skip(ftype)
1833
      else:
1848
      else:
1834
        iprot.skip(ftype)
1849
        iprot.skip(ftype)
Line 1841... Line 1856...
1841
      return
1856
      return
1842
    oprot.writeStructBegin('getHolidays_result')
1857
    oprot.writeStructBegin('getHolidays_result')
1843
    if self.success != None:
1858
    if self.success != None:
1844
      oprot.writeFieldBegin('success', TType.LIST, 0)
1859
      oprot.writeFieldBegin('success', TType.LIST, 0)
1845
      oprot.writeListBegin(TType.I64, len(self.success))
1860
      oprot.writeListBegin(TType.I64, len(self.success))
1846
      for iter20 in self.success:
1861
      for iter29 in self.success:
1847
        oprot.writeI64(iter20)
1862
        oprot.writeI64(iter29)
1848
      oprot.writeListEnd()
1863
      oprot.writeListEnd()
1849
      oprot.writeFieldEnd()
1864
      oprot.writeFieldEnd()
1850
    oprot.writeFieldStop()
1865
    oprot.writeFieldStop()
1851
    oprot.writeStructEnd()
1866
    oprot.writeStructEnd()
1852
 
1867