Subversion Repositories SmartDukaan

Rev

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

Rev 412 Rev 442
Line 39... Line 39...
39
    Parameters:
39
    Parameters:
40
     - provider_id
40
     - provider_id
41
    """
41
    """
42
    pass
42
    pass
43
 
43
 
-
 
44
  def createShipment(self, shipment):
-
 
45
    """
-
 
46
    Parameters:
-
 
47
     - shipment
-
 
48
    """
-
 
49
    pass
-
 
50
 
-
 
51
  def updateShipmentStatus(self, awb, shipment_update):
-
 
52
    """
-
 
53
    Parameters:
-
 
54
     - awb
-
 
55
     - shipment_update
-
 
56
    """
-
 
57
    pass
-
 
58
 
44
  def getShipmentInfo(self, awb):
59
  def getShipmentInfo(self, awb):
45
    """
60
    """
46
    Parameters:
61
    Parameters:
47
     - awb
62
     - awb
48
    """
63
    """
Line 187... Line 202...
187
    self._iprot.readMessageEnd()
202
    self._iprot.readMessageEnd()
188
    if result.success != None:
203
    if result.success != None:
189
      return result.success
204
      return result.success
190
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getProvider failed: unknown result");
205
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getProvider failed: unknown result");
191
 
206
 
-
 
207
  def createShipment(self, shipment):
-
 
208
    """
-
 
209
    Parameters:
-
 
210
     - shipment
-
 
211
    """
-
 
212
    self.send_createShipment(shipment)
-
 
213
    self.recv_createShipment()
-
 
214
 
-
 
215
  def send_createShipment(self, shipment):
-
 
216
    self._oprot.writeMessageBegin('createShipment', TMessageType.CALL, self._seqid)
-
 
217
    args = createShipment_args()
-
 
218
    args.shipment = shipment
-
 
219
    args.write(self._oprot)
-
 
220
    self._oprot.writeMessageEnd()
-
 
221
    self._oprot.trans.flush()
-
 
222
 
-
 
223
  def recv_createShipment(self, ):
-
 
224
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
225
    if mtype == TMessageType.EXCEPTION:
-
 
226
      x = TApplicationException()
-
 
227
      x.read(self._iprot)
-
 
228
      self._iprot.readMessageEnd()
-
 
229
      raise x
-
 
230
    result = createShipment_result()
-
 
231
    result.read(self._iprot)
-
 
232
    self._iprot.readMessageEnd()
-
 
233
    return
-
 
234
 
-
 
235
  def updateShipmentStatus(self, awb, shipment_update):
-
 
236
    """
-
 
237
    Parameters:
-
 
238
     - awb
-
 
239
     - shipment_update
-
 
240
    """
-
 
241
    self.send_updateShipmentStatus(awb, shipment_update)
-
 
242
    self.recv_updateShipmentStatus()
-
 
243
 
-
 
244
  def send_updateShipmentStatus(self, awb, shipment_update):
-
 
245
    self._oprot.writeMessageBegin('updateShipmentStatus', TMessageType.CALL, self._seqid)
-
 
246
    args = updateShipmentStatus_args()
-
 
247
    args.awb = awb
-
 
248
    args.shipment_update = shipment_update
-
 
249
    args.write(self._oprot)
-
 
250
    self._oprot.writeMessageEnd()
-
 
251
    self._oprot.trans.flush()
-
 
252
 
-
 
253
  def recv_updateShipmentStatus(self, ):
-
 
254
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
255
    if mtype == TMessageType.EXCEPTION:
-
 
256
      x = TApplicationException()
-
 
257
      x.read(self._iprot)
-
 
258
      self._iprot.readMessageEnd()
-
 
259
      raise x
-
 
260
    result = updateShipmentStatus_result()
-
 
261
    result.read(self._iprot)
-
 
262
    self._iprot.readMessageEnd()
-
 
263
    return
-
 
264
 
192
  def getShipmentInfo(self, awb):
265
  def getShipmentInfo(self, awb):
193
    """
266
    """
194
    Parameters:
267
    Parameters:
195
     - awb
268
     - awb
196
    """
269
    """
Line 294... Line 367...
294
    self._processMap = {}
367
    self._processMap = {}
295
    self._processMap["addEmptyAWBs"] = Processor.process_addEmptyAWBs
368
    self._processMap["addEmptyAWBs"] = Processor.process_addEmptyAWBs
296
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
369
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
297
    self._processMap["getProviders"] = Processor.process_getProviders
370
    self._processMap["getProviders"] = Processor.process_getProviders
298
    self._processMap["getProvider"] = Processor.process_getProvider
371
    self._processMap["getProvider"] = Processor.process_getProvider
-
 
372
    self._processMap["createShipment"] = Processor.process_createShipment
-
 
373
    self._processMap["updateShipmentStatus"] = Processor.process_updateShipmentStatus
299
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
374
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
300
    self._processMap["getShipments"] = Processor.process_getShipments
375
    self._processMap["getShipments"] = Processor.process_getShipments
301
    self._processMap["getTodaysShipments"] = Processor.process_getTodaysShipments
376
    self._processMap["getTodaysShipments"] = Processor.process_getTodaysShipments
302
 
377
 
303
  def process(self, iprot, oprot):
378
  def process(self, iprot, oprot):
Line 357... Line 432...
357
    oprot.writeMessageBegin("getProvider", TMessageType.REPLY, seqid)
432
    oprot.writeMessageBegin("getProvider", TMessageType.REPLY, seqid)
358
    result.write(oprot)
433
    result.write(oprot)
359
    oprot.writeMessageEnd()
434
    oprot.writeMessageEnd()
360
    oprot.trans.flush()
435
    oprot.trans.flush()
361
 
436
 
-
 
437
  def process_createShipment(self, seqid, iprot, oprot):
-
 
438
    args = createShipment_args()
-
 
439
    args.read(iprot)
-
 
440
    iprot.readMessageEnd()
-
 
441
    result = createShipment_result()
-
 
442
    self._handler.createShipment(args.shipment)
-
 
443
    oprot.writeMessageBegin("createShipment", TMessageType.REPLY, seqid)
-
 
444
    result.write(oprot)
-
 
445
    oprot.writeMessageEnd()
-
 
446
    oprot.trans.flush()
-
 
447
 
-
 
448
  def process_updateShipmentStatus(self, seqid, iprot, oprot):
-
 
449
    args = updateShipmentStatus_args()
-
 
450
    args.read(iprot)
-
 
451
    iprot.readMessageEnd()
-
 
452
    result = updateShipmentStatus_result()
-
 
453
    self._handler.updateShipmentStatus(args.awb, args.shipment_update)
-
 
454
    oprot.writeMessageBegin("updateShipmentStatus", TMessageType.REPLY, seqid)
-
 
455
    result.write(oprot)
-
 
456
    oprot.writeMessageEnd()
-
 
457
    oprot.trans.flush()
-
 
458
 
362
  def process_getShipmentInfo(self, seqid, iprot, oprot):
459
  def process_getShipmentInfo(self, seqid, iprot, oprot):
363
    args = getShipmentInfo_args()
460
    args = getShipmentInfo_args()
364
    args.read(iprot)
461
    args.read(iprot)
365
    iprot.readMessageEnd()
462
    iprot.readMessageEnd()
366
    result = getShipmentInfo_result()
463
    result = getShipmentInfo_result()
Line 823... Line 920...
823
    oprot.writeFieldStop()
920
    oprot.writeFieldStop()
824
    oprot.writeStructEnd()
921
    oprot.writeStructEnd()
825
 
922
 
826
  def __repr__(self):
923
  def __repr__(self):
827
    L = ['%s=%r' % (key, value)
924
    L = ['%s=%r' % (key, value)
-
 
925
      for key, value in self.__dict__.iteritems()]
-
 
926
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
927
 
-
 
928
  def __eq__(self, other):
-
 
929
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
930
 
-
 
931
  def __ne__(self, other):
-
 
932
    return not (self == other)
-
 
933
 
-
 
934
class createShipment_args:
-
 
935
  """
-
 
936
  Attributes:
-
 
937
   - shipment
-
 
938
  """
-
 
939
 
-
 
940
  thrift_spec = (
-
 
941
    None, # 0
-
 
942
    (1, TType.STRUCT, 'shipment', (Shipment, Shipment.thrift_spec), None, ), # 1
-
 
943
  )
-
 
944
 
-
 
945
  def __init__(self, shipment=None,):
-
 
946
    self.shipment = shipment
-
 
947
 
-
 
948
  def read(self, iprot):
-
 
949
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
950
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
951
      return
-
 
952
    iprot.readStructBegin()
-
 
953
    while True:
-
 
954
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
955
      if ftype == TType.STOP:
-
 
956
        break
-
 
957
      if fid == 1:
-
 
958
        if ftype == TType.STRUCT:
-
 
959
          self.shipment = Shipment()
-
 
960
          self.shipment.read(iprot)
-
 
961
        else:
-
 
962
          iprot.skip(ftype)
-
 
963
      else:
-
 
964
        iprot.skip(ftype)
-
 
965
      iprot.readFieldEnd()
-
 
966
    iprot.readStructEnd()
-
 
967
 
-
 
968
  def write(self, oprot):
-
 
969
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
970
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
971
      return
-
 
972
    oprot.writeStructBegin('createShipment_args')
-
 
973
    if self.shipment != None:
-
 
974
      oprot.writeFieldBegin('shipment', TType.STRUCT, 1)
-
 
975
      self.shipment.write(oprot)
-
 
976
      oprot.writeFieldEnd()
-
 
977
    oprot.writeFieldStop()
-
 
978
    oprot.writeStructEnd()
-
 
979
 
-
 
980
  def __repr__(self):
-
 
981
    L = ['%s=%r' % (key, value)
-
 
982
      for key, value in self.__dict__.iteritems()]
-
 
983
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
984
 
-
 
985
  def __eq__(self, other):
-
 
986
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
987
 
-
 
988
  def __ne__(self, other):
-
 
989
    return not (self == other)
-
 
990
 
-
 
991
class createShipment_result:
-
 
992
 
-
 
993
  thrift_spec = (
-
 
994
  )
-
 
995
 
-
 
996
  def read(self, iprot):
-
 
997
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
998
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
999
      return
-
 
1000
    iprot.readStructBegin()
-
 
1001
    while True:
-
 
1002
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1003
      if ftype == TType.STOP:
-
 
1004
        break
-
 
1005
      else:
-
 
1006
        iprot.skip(ftype)
-
 
1007
      iprot.readFieldEnd()
-
 
1008
    iprot.readStructEnd()
-
 
1009
 
-
 
1010
  def write(self, oprot):
-
 
1011
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1012
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1013
      return
-
 
1014
    oprot.writeStructBegin('createShipment_result')
-
 
1015
    oprot.writeFieldStop()
-
 
1016
    oprot.writeStructEnd()
-
 
1017
 
-
 
1018
  def __repr__(self):
-
 
1019
    L = ['%s=%r' % (key, value)
-
 
1020
      for key, value in self.__dict__.iteritems()]
-
 
1021
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1022
 
-
 
1023
  def __eq__(self, other):
-
 
1024
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1025
 
-
 
1026
  def __ne__(self, other):
-
 
1027
    return not (self == other)
-
 
1028
 
-
 
1029
class updateShipmentStatus_args:
-
 
1030
  """
-
 
1031
  Attributes:
-
 
1032
   - awb
-
 
1033
   - shipment_update
-
 
1034
  """
-
 
1035
 
-
 
1036
  thrift_spec = (
-
 
1037
    None, # 0
-
 
1038
    (1, TType.STRING, 'awb', None, None, ), # 1
-
 
1039
    (2, TType.STRUCT, 'shipment_update', (ShipmentUpdate, ShipmentUpdate.thrift_spec), None, ), # 2
-
 
1040
  )
-
 
1041
 
-
 
1042
  def __init__(self, awb=None, shipment_update=None,):
-
 
1043
    self.awb = awb
-
 
1044
    self.shipment_update = shipment_update
-
 
1045
 
-
 
1046
  def read(self, iprot):
-
 
1047
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1048
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1049
      return
-
 
1050
    iprot.readStructBegin()
-
 
1051
    while True:
-
 
1052
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1053
      if ftype == TType.STOP:
-
 
1054
        break
-
 
1055
      if fid == 1:
-
 
1056
        if ftype == TType.STRING:
-
 
1057
          self.awb = iprot.readString();
-
 
1058
        else:
-
 
1059
          iprot.skip(ftype)
-
 
1060
      elif fid == 2:
-
 
1061
        if ftype == TType.STRUCT:
-
 
1062
          self.shipment_update = ShipmentUpdate()
-
 
1063
          self.shipment_update.read(iprot)
-
 
1064
        else:
-
 
1065
          iprot.skip(ftype)
-
 
1066
      else:
-
 
1067
        iprot.skip(ftype)
-
 
1068
      iprot.readFieldEnd()
-
 
1069
    iprot.readStructEnd()
-
 
1070
 
-
 
1071
  def write(self, oprot):
-
 
1072
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1073
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1074
      return
-
 
1075
    oprot.writeStructBegin('updateShipmentStatus_args')
-
 
1076
    if self.awb != None:
-
 
1077
      oprot.writeFieldBegin('awb', TType.STRING, 1)
-
 
1078
      oprot.writeString(self.awb)
-
 
1079
      oprot.writeFieldEnd()
-
 
1080
    if self.shipment_update != None:
-
 
1081
      oprot.writeFieldBegin('shipment_update', TType.STRUCT, 2)
-
 
1082
      self.shipment_update.write(oprot)
-
 
1083
      oprot.writeFieldEnd()
-
 
1084
    oprot.writeFieldStop()
-
 
1085
    oprot.writeStructEnd()
-
 
1086
 
-
 
1087
  def __repr__(self):
-
 
1088
    L = ['%s=%r' % (key, value)
-
 
1089
      for key, value in self.__dict__.iteritems()]
-
 
1090
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1091
 
-
 
1092
  def __eq__(self, other):
-
 
1093
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1094
 
-
 
1095
  def __ne__(self, other):
-
 
1096
    return not (self == other)
-
 
1097
 
-
 
1098
class updateShipmentStatus_result:
-
 
1099
 
-
 
1100
  thrift_spec = (
-
 
1101
  )
-
 
1102
 
-
 
1103
  def read(self, iprot):
-
 
1104
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1105
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1106
      return
-
 
1107
    iprot.readStructBegin()
-
 
1108
    while True:
-
 
1109
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1110
      if ftype == TType.STOP:
-
 
1111
        break
-
 
1112
      else:
-
 
1113
        iprot.skip(ftype)
-
 
1114
      iprot.readFieldEnd()
-
 
1115
    iprot.readStructEnd()
-
 
1116
 
-
 
1117
  def write(self, oprot):
-
 
1118
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1119
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1120
      return
-
 
1121
    oprot.writeStructBegin('updateShipmentStatus_result')
-
 
1122
    oprot.writeFieldStop()
-
 
1123
    oprot.writeStructEnd()
-
 
1124
 
-
 
1125
  def __repr__(self):
-
 
1126
    L = ['%s=%r' % (key, value)
828
      for key, value in self.__dict__.iteritems()]
1127
      for key, value in self.__dict__.iteritems()]
829
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1128
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
830
 
1129
 
831
  def __eq__(self, other):
1130
  def __eq__(self, other):
832
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1131
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__