def write(self, oprot):
    self.validate()
    oprot.writeStructBegin('thing')
    if (self.an_id is not None):
        oprot.writeFieldBegin('an_id', TType.I32, 1)
        oprot.writeI32(self.an_id)
        oprot.writeFieldEnd()
    if (self.a_string is not None):
        oprot.writeFieldBegin('a_string', TType.STRING, 2)
        oprot.writeString(self.a_string)
        oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()
def write(self, oprot):
    self.validate()
    oprot.writeStructBegin('thing')
    if (self.an_id is not None):
        oprot.writeFieldBegin('an_id', TType.I32, 1)
        oprot.writeI32(self.an_id)
        oprot.writeFieldEnd()
    if (self.a_string is not None):
        oprot.writeFieldBegin('a_string', TType.STRING, 2)
        oprot.writeString(self.a_string)
        oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()