@Override
 public void write(org.apache.thrift.protocol.TProtocol prot, AnnouncementResponse struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetAnnouncements()) {
     optionals.set(0);
   }
   oprot.writeBitSet(optionals, 1);
   if (struct.isSetAnnouncements()) {
     {
       oprot.writeI32(struct.announcements.size());
       for (Announcement _iter76 : struct.announcements) {
         _iter76.write(oprot);
       }
     }
   }
 }
    public void write(org.apache.thrift.protocol.TProtocol oprot, AnnouncementResponse struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.announcements != null) {
        if (struct.isSetAnnouncements()) {
          oprot.writeFieldBegin(ANNOUNCEMENTS_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.STRUCT, struct.announcements.size()));
            for (Announcement _iter75 : struct.announcements) {
              _iter75.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }