Rev 353 | Rev 494 | 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 sendMail(self, mail):"""Parameters:"""passdef sendText(self, message):"""Parameters:- message"""passdef addMessage(self, message):"""Parameters:- message"""passdef updateMessage(self, id, message):"""Parameters:- id- message"""passdef getMessage(self, id):"""Parameters:- id"""passdef getSubstitutedMessage(self, id, params):"""Parameters:- id- params"""passclass Client(Iface):def __init__(self, iprot, oprot=None):self._iprot = self._oprot = iprotif oprot != None:self._oprot = oprotself._seqid = 0def sendMail(self, mail):"""Parameters:"""self.send_sendMail(mail)self.recv_sendMail()def send_sendMail(self, mail):self._oprot.writeMessageBegin('sendMail', TMessageType.CALL, self._seqid)args = sendMail_args()args.mail = mailargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_sendMail(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = sendMail_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.se != None:raise result.sereturndef sendText(self, message):"""Parameters:- message"""self.send_sendText(message)self.recv_sendText()def send_sendText(self, message):self._oprot.writeMessageBegin('sendText', TMessageType.CALL, self._seqid)args = sendText_args()args.message = messageargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_sendText(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = sendText_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.se != None:raise result.sereturndef addMessage(self, message):"""Parameters:- message"""self.send_addMessage(message)self.recv_addMessage()def send_addMessage(self, message):self._oprot.writeMessageBegin('addMessage', TMessageType.CALL, self._seqid)args = addMessage_args()args.message = messageargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_addMessage(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = addMessage_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.se != None:raise result.sereturndef updateMessage(self, id, message):"""Parameters:- id- message"""self.send_updateMessage(id, message)self.recv_updateMessage()def send_updateMessage(self, id, message):self._oprot.writeMessageBegin('updateMessage', TMessageType.CALL, self._seqid)args = updateMessage_args()args.id = idargs.message = messageargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_updateMessage(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = updateMessage_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.se != None:raise result.sereturndef getMessage(self, id):"""Parameters:- id"""self.send_getMessage(id)return self.recv_getMessage()def send_getMessage(self, id):self._oprot.writeMessageBegin('getMessage', TMessageType.CALL, self._seqid)args = getMessage_args()args.id = idargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getMessage(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getMessage_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, "getMessage failed: unknown result");def getSubstitutedMessage(self, id, params):"""Parameters:- id- params"""self.send_getSubstitutedMessage(id, params)return self.recv_getSubstitutedMessage()def send_getSubstitutedMessage(self, id, params):self._oprot.writeMessageBegin('getSubstitutedMessage', TMessageType.CALL, self._seqid)args = getSubstitutedMessage_args()args.id = idargs.params = paramsargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getSubstitutedMessage(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getSubstitutedMessage_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, "getSubstitutedMessage failed: unknown result");class Processor(Iface, TProcessor):def __init__(self, handler):self._handler = handlerself._processMap = {}self._processMap["sendMail"] = Processor.process_sendMailself._processMap["sendText"] = Processor.process_sendTextself._processMap["addMessage"] = Processor.process_addMessageself._processMap["updateMessage"] = Processor.process_updateMessageself._processMap["getMessage"] = Processor.process_getMessageself._processMap["getSubstitutedMessage"] = Processor.process_getSubstitutedMessagedef 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_sendMail(self, seqid, iprot, oprot):args = sendMail_args()args.read(iprot)iprot.readMessageEnd()result = sendMail_result()try:self._handler.sendMail(args.mail)except HelperServiceException, se:result.se = seoprot.writeMessageBegin("sendMail", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_sendText(self, seqid, iprot, oprot):args = sendText_args()args.read(iprot)iprot.readMessageEnd()result = sendText_result()try:self._handler.sendText(args.message)except HelperServiceException, se:result.se = seoprot.writeMessageBegin("sendText", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_addMessage(self, seqid, iprot, oprot):args = addMessage_args()args.read(iprot)iprot.readMessageEnd()result = addMessage_result()try:self._handler.addMessage(args.message)except HelperServiceException, se:result.se = seoprot.writeMessageBegin("addMessage", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_updateMessage(self, seqid, iprot, oprot):args = updateMessage_args()args.read(iprot)iprot.readMessageEnd()result = updateMessage_result()try:self._handler.updateMessage(args.id, args.message)except HelperServiceException, se:result.se = seoprot.writeMessageBegin("updateMessage", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getMessage(self, seqid, iprot, oprot):args = getMessage_args()args.read(iprot)iprot.readMessageEnd()result = getMessage_result()try:result.success = self._handler.getMessage(args.id)except HelperServiceException, se:result.se = seoprot.writeMessageBegin("getMessage", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_getSubstitutedMessage(self, seqid, iprot, oprot):args = getSubstitutedMessage_args()args.read(iprot)iprot.readMessageEnd()result = getSubstitutedMessage_result()try:result.success = self._handler.getSubstitutedMessage(args.id, args.params)except HelperServiceException, se:result.se = seoprot.writeMessageBegin("getSubstitutedMessage", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()# HELPER FUNCTIONS AND STRUCTURESclass sendMail_args:"""Attributes:"""thrift_spec = (None, # 0(1, TType.STRUCT, 'mail', (Mail, Mail.thrift_spec), None, ), # 1)def __init__(self, mail=None,):self.mail = maildef 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.STRUCT:self.mail = Mail()self.mail.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('sendMail_args')if self.mail != None:oprot.writeFieldBegin('mail', TType.STRUCT, 1)self.mail.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 sendMail_result:"""Attributes:- se"""thrift_spec = (None, # 0(1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1)def __init__(self, se=None,):self.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 == 1:if ftype == TType.STRUCT:self.se = HelperServiceException()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('sendMail_result')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 sendText_args:"""Attributes:- message"""thrift_spec = (None, # 0(1, TType.STRUCT, 'message', (TextMessage, TextMessage.thrift_spec), None, ), # 1)def __init__(self, message=None,):self.message = messagedef 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.STRUCT:self.message = TextMessage()self.message.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('sendText_args')if self.message != None:oprot.writeFieldBegin('message', TType.STRUCT, 1)self.message.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 sendText_result:"""Attributes:- se"""thrift_spec = (None, # 0(1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1)def __init__(self, se=None,):self.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 == 1:if ftype == TType.STRUCT:self.se = HelperServiceException()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('sendText_result')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 addMessage_args:"""Attributes:- message"""thrift_spec = (None, # 0(1, TType.STRUCT, 'message', (Message, Message.thrift_spec), None, ), # 1)def __init__(self, message=None,):self.message = messagedef 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.STRUCT:self.message = Message()self.message.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('addMessage_args')if self.message != None:oprot.writeFieldBegin('message', TType.STRUCT, 1)self.message.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 addMessage_result:"""Attributes:- se"""thrift_spec = (None, # 0(1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1)def __init__(self, se=None,):self.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 == 1:if ftype == TType.STRUCT:self.se = HelperServiceException()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('addMessage_result')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 updateMessage_args:"""Attributes:- id- message"""thrift_spec = (None, # 0(1, TType.I64, 'id', None, None, ), # 1(2, TType.STRING, 'message', None, None, ), # 2)def __init__(self, id=None, message=None,):self.id = idself.message = messagedef 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.id = iprot.readI64();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.STRING:self.message = 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('updateMessage_args')if self.id != None:oprot.writeFieldBegin('id', TType.I64, 1)oprot.writeI64(self.id)oprot.writeFieldEnd()if self.message != None:oprot.writeFieldBegin('message', TType.STRING, 2)oprot.writeString(self.message)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 updateMessage_result:"""Attributes:- se"""thrift_spec = (None, # 0(1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1)def __init__(self, se=None,):self.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 == 1:if ftype == TType.STRUCT:self.se = HelperServiceException()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('updateMessage_result')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 getMessage_args:"""Attributes:- id"""thrift_spec = (None, # 0(1, TType.I64, 'id', None, None, ), # 1)def __init__(self, id=None,):self.id = 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.I64:self.id = 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('getMessage_args')if self.id != None:oprot.writeFieldBegin('id', TType.I64, 1)oprot.writeI64(self.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 getMessage_result:"""Attributes:- success- se"""thrift_spec = ((0, TType.STRUCT, 'success', (Message, Message.thrift_spec), None, ), # 0(1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.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 = Message()self.success.read(iprot)else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.se = HelperServiceException()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('getMessage_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 getSubstitutedMessage_args:"""Attributes:- id- params"""thrift_spec = (None, # 0(1, TType.I64, 'id', None, None, ), # 1(2, TType.MAP, 'params', (TType.STRING,None,TType.STRING,None), None, ), # 2)def __init__(self, id=None, params=None,):self.id = idself.params = paramsdef 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.id = iprot.readI64();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.MAP:self.params = {}(_ktype15, _vtype16, _size14 ) = iprot.readMapBegin()for _i18 in xrange(_size14):_key19 = iprot.readString();_val20 = iprot.readString();self.params[_key19] = _val20iprot.readMapEnd()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('getSubstitutedMessage_args')if self.id != None:oprot.writeFieldBegin('id', TType.I64, 1)oprot.writeI64(self.id)oprot.writeFieldEnd()if self.params != None:oprot.writeFieldBegin('params', TType.MAP, 2)oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))for kiter21,viter22 in self.params.items():oprot.writeString(kiter21)oprot.writeString(viter22)oprot.writeMapEnd()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 getSubstitutedMessage_result:"""Attributes:- success- se"""thrift_spec = ((0, TType.STRUCT, 'success', (Message, Message.thrift_spec), None, ), # 0(1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.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 = Message()self.success.read(iprot)else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.se = HelperServiceException()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('getSubstitutedMessage_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)