public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("TDDIOutputFailure");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (__isset.Id)
         {
             field.Name = "Id";
             field.Type = TType.I64;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(Id);
             oprot.WriteFieldEnd();
         }
         if (Name != null && __isset.Name)
         {
             field.Name = "Name";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Name);
             oprot.WriteFieldEnd();
         }
         if (Description != null && __isset.Description)
         {
             field.Name = "Description";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Description);
             oprot.WriteFieldEnd();
         }
         if (__isset.IsCitation)
         {
             field.Name = "IsCitation";
             field.Type = TType.Bool;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             oprot.WriteBool(IsCitation);
             oprot.WriteFieldEnd();
         }
         if (__isset.IsAbstract)
         {
             field.Name = "IsAbstract";
             field.Type = TType.Bool;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             oprot.WriteBool(IsAbstract);
             oprot.WriteFieldEnd();
         }
         if (KeyValueMaps != null && __isset.KeyValueMaps)
         {
             field.Name = "KeyValueMaps";
             field.Type = TType.List;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, KeyValueMaps.Count));
                 foreach (TDDIKeyValueMapRef _iter454 in KeyValueMaps)
                 {
                     _iter454.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (CitedElement != null && __isset.CitedElement)
         {
             field.Name = "CitedElement";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             CitedElement.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (__isset.FailureRate)
         {
             field.Name = "FailureRate";
             field.Type = TType.Double;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             oprot.WriteDouble(FailureRate);
             oprot.WriteFieldEnd();
         }
         if (FailureMode != null && __isset.FailureMode)
         {
             field.Name = "FailureMode";
             field.Type = TType.Struct;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             FailureMode.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ProbabilityDistribution != null && __isset.ProbabilityDistribution)
         {
             field.Name = "ProbabilityDistribution";
             field.Type = TType.Struct;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             ProbabilityDistribution.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (MinimalCutsets != null && __isset.MinimalCutsets)
         {
             field.Name = "MinimalCutsets";
             field.Type = TType.List;
             field.ID   = 11;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, MinimalCutsets.Count));
                 foreach (TDDIMinimalCutset _iter455 in MinimalCutsets)
                 {
                     _iter455.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("TDDIFailureAnalysisArtifactUnion");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (FailureLogicPackage != null && __isset.FailureLogicPackage)
         {
             field.Name = "FailureLogicPackage";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             FailureLogicPackage.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (MinimalCutset != null && __isset.MinimalCutset)
         {
             field.Name = "MinimalCutset";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             MinimalCutset.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (InterfaceFailurePropagation != null && __isset.InterfaceFailurePropagation)
         {
             field.Name = "InterfaceFailurePropagation";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             InterfaceFailurePropagation.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Failure != null && __isset.Failure)
         {
             field.Name = "Failure";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             Failure.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (FailureMode != null && __isset.FailureMode)
         {
             field.Name = "FailureMode";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             FailureMode.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ProbabilityDistribution != null && __isset.ProbabilityDistribution)
         {
             field.Name = "ProbabilityDistribution";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             ProbabilityDistribution.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ProbDistParam != null && __isset.ProbDistParam)
         {
             field.Name = "ProbDistParam";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             ProbDistParam.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (FTAArtifact != null && __isset.FTAArtifact)
         {
             field.Name = "FTAArtifact";
             field.Type = TType.Struct;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             FTAArtifact.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (FMEAArtifact != null && __isset.FMEAArtifact)
         {
             field.Name = "FMEAArtifact";
             field.Type = TType.Struct;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             FMEAArtifact.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (MarkovArtifact != null && __isset.MarkovArtifact)
         {
             field.Name = "MarkovArtifact";
             field.Type = TType.Struct;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             MarkovArtifact.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }