public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            Ref = new TDDIAbstractCause();
                            Ref.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.I64)
                        {
                            Id = iprot.ReadI64();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            Name = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Description = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                KeyValueMaps = new List <TDDIKeyValueMap>();
                                TList _list496 = iprot.ReadListBegin();
                                for (int _i497 = 0; _i497 < _list496.Count; ++_i497)
                                {
                                    TDDIKeyValueMap _elem498;
                                    _elem498 = new TDDIKeyValueMap();
                                    _elem498.Read(iprot);
                                    KeyValueMaps.Add(_elem498);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                MinimalCutSets = new List <TDDIMinimalCutSets>();
                                TList _list499 = iprot.ReadListBegin();
                                for (int _i500 = 0; _i500 < _list499.Count; ++_i500)
                                {
                                    TDDIMinimalCutSets _elem501;
                                    _elem501 = new TDDIMinimalCutSets();
                                    _elem501.Read(iprot);
                                    MinimalCutSets.Add(_elem501);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.List)
                        {
                            {
                                Failures = new List <TDDIAbstractFailure>();
                                TList _list502 = iprot.ReadListBegin();
                                for (int _i503 = 0; _i503 < _list502.Count; ++_i503)
                                {
                                    TDDIAbstractFailure _elem504;
                                    _elem504 = new TDDIAbstractFailure();
                                    _elem504.Read(iprot);
                                    Failures.Add(_elem504);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                SubModels = new List <TDDIAbstractFailureModelRef>();
                                TList _list505 = iprot.ReadListBegin();
                                for (int _i506 = 0; _i506 < _list505.Count; ++_i506)
                                {
                                    TDDIAbstractFailureModelRef _elem507;
                                    _elem507 = new TDDIAbstractFailureModelRef();
                                    _elem507.Read(iprot);
                                    SubModels.Add(_elem507);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                Causes = new List <TDDIAbstractCause>();
                                TList _list508 = iprot.ReadListBegin();
                                for (int _i509 = 0; _i509 < _list508.Count; ++_i509)
                                {
                                    TDDIAbstractCause _elem510;
                                    _elem510 = new TDDIAbstractCause();
                                    _elem510.Read(iprot);
                                    Causes.Add(_elem510);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }