Rev 647 | Rev 675 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
## Autogenerated by Thrift## DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING#from thrift.Thrift import *from ttypes import *from thrift.Thrift import TProcessorfrom thrift.transport import TTransportfrom thrift.protocol import TBinaryProtocoltry:from thrift.protocol import fastbinaryexcept:fastbinary = Noneclass Iface:def getProvider(self, providerId):"""Returns a provider for a given provider ID. Throws an exception if none found.Parameters:- providerId"""passdef getLogisticsEstimation(self, itemId, destination_pin):"""Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincodeis allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.Parameters:- itemId- destination_pin"""passdef getLogisticsInfo(self, destination_pincode, item_id):"""Same as above excpet that an airway bill number is also allocated and returned.Parameters:- destination_pincode- item_id"""passdef getEmptyAWB(self, providerId):"""Returns an unused AWB number for the given provider.Parameters:- providerId"""passdef getShipmentInfo(self, awb, providerId):"""Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.Parameters:- awb- providerId"""passclass Client(Iface):def __init__(self, iprot, oprot=None):self._iprot = self._oprot = iprotif oprot != None:self._oprot = oprotself._seqid = 0def getProvider(self, providerId):"""Returns a provider for a given provider ID. Throws an exception if none found.Parameters:- providerId"""self.send_getProvider(providerId)return self.recv_getProvider()def send_getProvider(self, providerId):self._oprot.writeMessageBegin('getProvider', TMessageType.CALL, self._seqid)args = getProvider_args()args.providerId = providerIdargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getProvider(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getProvider_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success != None:return result.successif result.lse != None:raise result.lseraise TApplicationException(TApplicationException.MISSING_RESULT, "getProvider failed: unknown result");def getLogisticsEstimation(self, itemId, destination_pin):"""Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincodeis allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.Parameters:- itemId- destination_pin"""self.send_getLogisticsEstimation(itemId, destination_pin)return self.recv_getLogisticsEstimation()def send_getLogisticsEstimation(self, itemId, destination_pin):self._oprot.writeMessageBegin('getLogisticsEstimation', TMessageType.CALL, self._seqid)args = getLogisticsEstimation_args()args.itemId = itemIdargs.destination_pin = destination_pinargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getLogisticsEstimation(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getLogisticsEstimation_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success != None:return result.successif result.se != None:raise result.seraise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");def getLogisticsInfo(self, destination_pincode, item_id):"""Same as above excpet that an airway bill number is also allocated and returned.Parameters:- destination_pincode- item_id"""self.send_getLogisticsInfo(destination_pincode, item_id)return self.recv_getLogisticsInfo()def send_getLogisticsInfo(self, destination_pincode, item_id):self._oprot.writeMessageBegin('getLogisticsInfo', TMessageType.CALL, self._seqid)args = getLogisticsInfo_args()args.destination_pincode = destination_pincodeargs.item_id = item_idargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getLogisticsInfo(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getLogisticsInfo_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success != None:return result.successif result.se != None:raise result.seraise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsInfo failed: unknown result");def getEmptyAWB(self, providerId):"""Returns an unused AWB number for the given provider.Parameters:- providerId"""self.send_getEmptyAWB(providerId)return self.recv_getEmptyAWB()def send_getEmptyAWB(self, providerId):self._oprot.writeMessageBegin('getEmptyAWB', TMessageType.CALL, self._seqid)args = getEmptyAWB_args()args.providerId = providerIdargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getEmptyAWB(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getEmptyAWB_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success != None:return result.successif result.se != None:raise result.seraise TApplicationException(TApplicationException.MISSING_RESULT, "getEmptyAWB failed: unknown result");def getShipmentInfo(self, awb, providerId):"""Returns the list of updates for the given AWB number and provider id. The list is empty if there are no updates yet.Parameters:- awb- providerId"""self.send_getShipmentInfo(awb, providerId)return self.recv_getShipmentInfo()def send_getShipmentInfo(self, awb, providerId):self._oprot.writeMessageBegin('getShipmentInfo', TMessageType.CALL, self._seqid)args = getShipmentInfo_args()args.awb = awbargs.providerId = providerIdargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getShipmentInfo(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getShipmentInfo_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success != None:return result.successif result.se != None:raise result.seraise TApplicationException(TApplicationException.MISSING_RESULT, "getShipmentInfo failed: unknown result");class Processor(Iface, TProcessor):def __init__(self, handler):self._handler = handlerself._processMap = {}self._processMap["getProvider"] = Processor.process_getProviderself._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimationself._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfoself._processMap["getEmptyAWB"] = Processor.process_getEmptyAWBself._processMap["getShipmentInfo"] = Processor.process_getShipmentInfodef process(self, iprot, oprot):(name, type, seqid) = iprot.readMessageBegin()if name not in self._processMap:iprot.skip(TType.STRUCT)iprot.readMessageEnd()x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)x.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()returnelse:self._processMap[name](self, seqid, iprot, oprot)return Truedef process_getProvider(self, seqid, iprot, oprot):args = getProvider_args()args.read(iprot)iprot.readMessageEnd()result = getProvider_result()try:result.success = self._handler.getProvider(args.providerId)except LogisticsServiceException, lse:result.lse = lseoprot.writeMessageBegin("getProvider", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getLogisticsEstimation(self, seqid, iprot, oprot):args = getLogisticsEstimation_args()args.read(iprot)iprot.readMessageEnd()result = getLogisticsEstimation_result()try:result.success = self._handler.getLogisticsEstimation(args.itemId, args.destination_pin)except LogisticsServiceException, se:result.se = seoprot.writeMessageBegin("getLogisticsEstimation", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getLogisticsInfo(self, seqid, iprot, oprot):args = getLogisticsInfo_args()args.read(iprot)iprot.readMessageEnd()result = getLogisticsInfo_result()try:result.success = self._handler.getLogisticsInfo(args.destination_pincode, args.item_id)except LogisticsServiceException, se:result.se = seoprot.writeMessageBegin("getLogisticsInfo", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getEmptyAWB(self, seqid, iprot, oprot):args = getEmptyAWB_args()args.read(iprot)iprot.readMessageEnd()result = getEmptyAWB_result()try:result.success = self._handler.getEmptyAWB(args.providerId)except LogisticsServiceException, se:result.se = seoprot.writeMessageBegin("getEmptyAWB", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getShipmentInfo(self, seqid, iprot, oprot):args = getShipmentInfo_args()args.read(iprot)iprot.readMessageEnd()result = getShipmentInfo_result()try:result.success = self._handler.getShipmentInfo(args.awb, args.providerId)except LogisticsServiceException, se:result.se = seoprot.writeMessageBegin("getShipmentInfo", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()# HELPER FUNCTIONS AND STRUCTURESclass getProvider_args:"""Attributes:- providerId"""thrift_spec = (None, # 0(1, TType.I64, 'providerId', None, None, ), # 1)def __init__(self, providerId=None,):self.providerId = providerIddef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.providerId = iprot.readI64();else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getProvider_args')if self.providerId != None:oprot.writeFieldBegin('providerId', TType.I64, 1)oprot.writeI64(self.providerId)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getProvider_result:"""Attributes:- success- lse"""thrift_spec = ((0, TType.STRUCT, 'success', (Provider, Provider.thrift_spec), None, ), # 0(1, TType.STRUCT, 'lse', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, lse=None,):self.success = successself.lse = lsedef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.STRUCT:self.success = Provider()self.success.read(iprot)else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.lse = LogisticsServiceException()self.lse.read(iprot)else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getProvider_result')if self.success != None:oprot.writeFieldBegin('success', TType.STRUCT, 0)self.success.write(oprot)oprot.writeFieldEnd()if self.lse != None:oprot.writeFieldBegin('lse', TType.STRUCT, 1)self.lse.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getLogisticsEstimation_args:"""Attributes:- itemId- destination_pin"""thrift_spec = (None, # 0(1, TType.I64, 'itemId', None, None, ), # 1(2, TType.STRING, 'destination_pin', None, None, ), # 2)def __init__(self, itemId=None, destination_pin=None,):self.itemId = itemIdself.destination_pin = destination_pindef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.itemId = iprot.readI64();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.STRING:self.destination_pin = iprot.readString();else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getLogisticsEstimation_args')if self.itemId != None:oprot.writeFieldBegin('itemId', TType.I64, 1)oprot.writeI64(self.itemId)oprot.writeFieldEnd()if self.destination_pin != None:oprot.writeFieldBegin('destination_pin', TType.STRING, 2)oprot.writeString(self.destination_pin)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getLogisticsEstimation_result:"""Attributes:- success- se"""thrift_spec = ((0, TType.STRUCT, 'success', (LogisticsInfo, LogisticsInfo.thrift_spec), None, ), # 0(1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, se=None,):self.success = successself.se = sedef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.STRUCT:self.success = LogisticsInfo()self.success.read(iprot)else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.se = LogisticsServiceException()self.se.read(iprot)else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getLogisticsEstimation_result')if self.success != None:oprot.writeFieldBegin('success', TType.STRUCT, 0)self.success.write(oprot)oprot.writeFieldEnd()if self.se != None:oprot.writeFieldBegin('se', TType.STRUCT, 1)self.se.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getLogisticsInfo_args:"""Attributes:- destination_pincode- item_id"""thrift_spec = (None, # 0(1, TType.STRING, 'destination_pincode', None, None, ), # 1(2, TType.STRING, 'item_id', None, None, ), # 2)def __init__(self, destination_pincode=None, item_id=None,):self.destination_pincode = destination_pincodeself.item_id = item_iddef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRING:self.destination_pincode = iprot.readString();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.STRING:self.item_id = iprot.readString();else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getLogisticsInfo_args')if self.destination_pincode != None:oprot.writeFieldBegin('destination_pincode', TType.STRING, 1)oprot.writeString(self.destination_pincode)oprot.writeFieldEnd()if self.item_id != None:oprot.writeFieldBegin('item_id', TType.STRING, 2)oprot.writeString(self.item_id)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getLogisticsInfo_result:"""Attributes:- success- se"""thrift_spec = ((0, TType.STRUCT, 'success', (LogisticsInfo, LogisticsInfo.thrift_spec), None, ), # 0(1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, se=None,):self.success = successself.se = sedef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.STRUCT:self.success = LogisticsInfo()self.success.read(iprot)else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.se = LogisticsServiceException()self.se.read(iprot)else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getLogisticsInfo_result')if self.success != None:oprot.writeFieldBegin('success', TType.STRUCT, 0)self.success.write(oprot)oprot.writeFieldEnd()if self.se != None:oprot.writeFieldBegin('se', TType.STRUCT, 1)self.se.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getEmptyAWB_args:"""Attributes:- providerId"""thrift_spec = (None, # 0(1, TType.I64, 'providerId', None, None, ), # 1)def __init__(self, providerId=None,):self.providerId = providerIddef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.I64:self.providerId = iprot.readI64();else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getEmptyAWB_args')if self.providerId != None:oprot.writeFieldBegin('providerId', TType.I64, 1)oprot.writeI64(self.providerId)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getEmptyAWB_result:"""Attributes:- success- se"""thrift_spec = ((0, TType.STRING, 'success', None, None, ), # 0(1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, se=None,):self.success = successself.se = sedef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.STRING:self.success = iprot.readString();else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.se = LogisticsServiceException()self.se.read(iprot)else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getEmptyAWB_result')if self.success != None:oprot.writeFieldBegin('success', TType.STRING, 0)oprot.writeString(self.success)oprot.writeFieldEnd()if self.se != None:oprot.writeFieldBegin('se', TType.STRUCT, 1)self.se.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getShipmentInfo_args:"""Attributes:- awb- providerId"""thrift_spec = (None, # 0(1, TType.STRING, 'awb', None, None, ), # 1(2, TType.I64, 'providerId', None, None, ), # 2)def __init__(self, awb=None, providerId=None,):self.awb = awbself.providerId = providerIddef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRING:self.awb = iprot.readString();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.I64:self.providerId = iprot.readI64();else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getShipmentInfo_args')if self.awb != None:oprot.writeFieldBegin('awb', TType.STRING, 1)oprot.writeString(self.awb)oprot.writeFieldEnd()if self.providerId != None:oprot.writeFieldBegin('providerId', TType.I64, 2)oprot.writeI64(self.providerId)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getShipmentInfo_result:"""Attributes:- success- se"""thrift_spec = ((0, TType.LIST, 'success', (TType.STRUCT,(AwbUpdate, AwbUpdate.thrift_spec)), None, ), # 0(1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1)def __init__(self, success=None, se=None,):self.success = successself.se = sedef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.LIST:self.success = [](_etype3, _size0) = iprot.readListBegin()for _i4 in xrange(_size0):_elem5 = AwbUpdate()_elem5.read(iprot)self.success.append(_elem5)iprot.readListEnd()else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.se = LogisticsServiceException()self.se.read(iprot)else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getShipmentInfo_result')if self.success != None:oprot.writeFieldBegin('success', TType.LIST, 0)oprot.writeListBegin(TType.STRUCT, len(self.success))for iter6 in self.success:iter6.write(oprot)oprot.writeListEnd()oprot.writeFieldEnd()if self.se != None:oprot.writeFieldBegin('se', TType.STRUCT, 1)self.se.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)