public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("ShouldSyncException");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (__isset.syncOpRevision)
         {
             field.Name = "syncOpRevision";
             field.Type = TType.I64;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(SyncOpRevision);
             oprot.WriteFieldEnd();
         }
         if (SyncScope != null && __isset.syncScope)
         {
             field.Name = "syncScope";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             SyncScope.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (__isset.syncReason)
         {
             field.Name = "syncReason";
             field.Type = TType.I32;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32((int)SyncReason);
             oprot.WriteFieldEnd();
         }
         if (Message != null && __isset.message)
         {
             field.Name = "message";
             field.Type = TType.String;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Message);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }