public void Write(TProtocol oprot)
{
TStruct struc = new TStruct("PrivilegeBag");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Privileges != null && __isset.privileges) {
field.Name = "privileges";
field.Type = TType.List;
field.ID = 1;
oprot.WriteFieldBegin(field);
{
oprot.WriteListBegin(new TList(TType.Struct, Privileges.Count));
foreach (HiveObjectPrivilege _iter11 in Privileges)
{
_iter11.Write(oprot);
}
oprot.WriteListEnd();
}
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}