public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.I32)
                    {
                        UserId = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

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

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

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            ToAddmobileContacts = new List <MobileContact>();
                            TList _list8 = iprot.ReadListBegin();
                            for (int _i9 = 0; _i9 < _list8.Count; ++_i9)
                            {
                                MobileContact _elem10;
                                _elem10 = new MobileContact();
                                _elem10.Read(iprot);
                                ToAddmobileContacts.Add(_elem10);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 6:
                    if (field.Type == TType.List)
                    {
                        {
                            ToDelmobileContacts = new List <MobileContact>();
                            TList _list11 = iprot.ReadListBegin();
                            for (int _i12 = 0; _i12 < _list11.Count; ++_i12)
                            {
                                MobileContact _elem13;
                                _elem13 = new MobileContact();
                                _elem13.Read(iprot);
                                ToDelmobileContacts.Add(_elem13);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

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

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

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.I32) {
           UserId = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.String) {
           DeviceId = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.String) {
           CTag = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.I32) {
           SystemDbStatus = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.List) {
           {
             ToAddmobileContacts = new List<MobileContact>();
             TList _list8 = iprot.ReadListBegin();
             for( int _i9 = 0; _i9 < _list8.Count; ++_i9)
             {
               MobileContact _elem10;
               _elem10 = new MobileContact();
               _elem10.Read(iprot);
               ToAddmobileContacts.Add(_elem10);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.List) {
           {
             ToDelmobileContacts = new List<MobileContact>();
             TList _list11 = iprot.ReadListBegin();
             for( int _i12 = 0; _i12 < _list11.Count; ++_i12)
             {
               MobileContact _elem13;
               _elem13 = new MobileContact();
               _elem13.Read(iprot);
               ToDelmobileContacts.Add(_elem13);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 7:
         if (field.Type == TType.I32) {
           DbSubStatusCode = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 8:
         if (field.Type == TType.String) {
           DbStatusMsg = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 9:
         if (field.Type == TType.Bool) {
           Flush = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }