Exemple #1
0
        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.Struct)
                    {
                        CondicoesDeSaude = new CondicoesDeSaudeThrift();
                        CondicoesDeSaude.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    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 3:
                    if (field.Type == TType.Struct)
                    {
                        EmSituacaoDeRua = new EmSituacaoDeRuaThrift();
                        EmSituacaoDeRua.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 5:
                    if (field.Type == TType.Struct)
                    {
                        IdentificacaoUsuarioCidadao = new IdentificacaoUsuarioCidadaoThrift();
                        IdentificacaoUsuarioCidadao.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 6:
                    if (field.Type == TType.Struct)
                    {
                        InformacoesSocioDemograficas = new InformacoesSocioDemograficasThrift();
                        InformacoesSocioDemograficas.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

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

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

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

                case 11:
                    if (field.Type == TType.String)
                    {
                        UuidCidadao = 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.Struct) {
           CondicoesDeSaude = new CondicoesDeSaudeThrift();
           CondicoesDeSaude.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         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 3:
         if (field.Type == TType.Struct) {
           EmSituacaoDeRua = new EmSituacaoDeRuaThrift();
           EmSituacaoDeRua.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.Bool) {
           FichaAtualizada = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.Struct) {
           IdentificacaoUsuarioCidadao = new IdentificacaoUsuarioCidadaoThrift();
           IdentificacaoUsuarioCidadao.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.Struct) {
           InformacoesSocioDemograficas = new InformacoesSocioDemograficasThrift();
           InformacoesSocioDemograficas.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 7:
         if (field.Type == TType.Bool) {
           StatusTermoRecusaCadastroIndividualAtencaoBasica = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 8:
         if (field.Type == TType.I32) {
           TpCdsOrigem = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 9:
         if (field.Type == TType.String) {
           Uuid = iprot.ReadString();
           isset_uuid = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 10:
         if (field.Type == TType.String) {
           UuidFichaOriginadora = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 11:
         if (field.Type == TType.String) {
           UuidCidadao = 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);
 }