public void Read(TProtocol iprot)
        {
            bool   isset_dadosGerais = false;
            bool   isset_uuid        = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            AnimaisNoDomicilio = new List <long>();
                            TList _list0 = iprot.ReadListBegin();
                            for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                            {
                                long _elem2;
                                _elem2 = iprot.ReadI64();
                                AnimaisNoDomicilio.Add(_elem2);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        CondicaoMoradia = new CondicaoMoradiaThrift();
                        CondicaoMoradia.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        DadosGerais = new br.gov.saude.esus.cds.transport.generated.thrift.common.HeaderCdsCadastroThrift();
                        DadosGerais.Read(iprot);
                        isset_dadosGerais = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Struct)
                    {
                        EnderecoLocalPermanencia = new br.gov.saude.esus.cds.transport.generated.thrift.common.EnderecoLocalPermanenciaThrift();
                        EnderecoLocalPermanencia.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            Familias = new List <FamiliaRowThrift>();
                            TList _list3 = iprot.ReadListBegin();
                            for (int _i4 = 0; _i4 < _list3.Count; ++_i4)
                            {
                                FamiliaRowThrift _elem5;
                                _elem5 = new FamiliaRowThrift();
                                _elem5.Read(iprot);
                                Familias.Add(_elem5);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 6:
                    if (field.Type == TType.Bool)
                    {
                        FichaAtualizada = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 8:
                    if (field.Type == TType.Bool)
                    {
                        StAnimaisNoDomicilio = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 9:
                    if (field.Type == TType.Bool)
                    {
                        StatusTermoRecusaCadastroDomiciliarAtencaoBasica = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 10:
                    if (field.Type == TType.I32)
                    {
                        TpCdsOrigem = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 11:
                    if (field.Type == TType.String)
                    {
                        Uuid       = iprot.ReadString();
                        isset_uuid = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_dadosGerais)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_uuid)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
 public void Read (TProtocol iprot)
 {
   bool isset_dadosGerais = false;
   bool isset_uuid = false;
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.List) {
           {
             AnimaisNoDomicilio = new List<long>();
             TList _list0 = iprot.ReadListBegin();
             for( int _i1 = 0; _i1 < _list0.Count; ++_i1)
             {
               long _elem2;
               _elem2 = iprot.ReadI64();
               AnimaisNoDomicilio.Add(_elem2);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           CondicaoMoradia = new CondicaoMoradiaThrift();
           CondicaoMoradia.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.Struct) {
           DadosGerais = new br.gov.saude.esus.cds.transport.generated.thrift.common.HeaderCdsCadastroThrift();
           DadosGerais.Read(iprot);
           isset_dadosGerais = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.Struct) {
           EnderecoLocalPermanencia = new br.gov.saude.esus.cds.transport.generated.thrift.common.EnderecoLocalPermanenciaThrift();
           EnderecoLocalPermanencia.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.List) {
           {
             Familias = new List<FamiliaRowThrift>();
             TList _list3 = iprot.ReadListBegin();
             for( int _i4 = 0; _i4 < _list3.Count; ++_i4)
             {
               FamiliaRowThrift _elem5;
               _elem5 = new FamiliaRowThrift();
               _elem5.Read(iprot);
               Familias.Add(_elem5);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.Bool) {
           FichaAtualizada = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 7:
         if (field.Type == TType.String) {
           QuantosAnimaisNoDomicilio = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 8:
         if (field.Type == TType.Bool) {
           StAnimaisNoDomicilio = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 9:
         if (field.Type == TType.Bool) {
           StatusTermoRecusaCadastroDomiciliarAtencaoBasica = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 10:
         if (field.Type == TType.I32) {
           TpCdsOrigem = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 11:
         if (field.Type == TType.String) {
           Uuid = iprot.ReadString();
           isset_uuid = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 12:
         if (field.Type == TType.String) {
           UuidFichaOriginadora = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_dadosGerais)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_uuid)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }