public static RemoveMemberRequest DeserializeLengthDelimited(Stream stream, RemoveMemberRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(RemoveMemberRequest.Deserialize(stream, instance, position));
        }
        public static RemoveMemberRequest DeserializeLengthDelimited(Stream stream)
        {
            RemoveMemberRequest removeMemberRequest = new RemoveMemberRequest();

            RemoveMemberRequest.DeserializeLengthDelimited(stream, removeMemberRequest);
            return(removeMemberRequest);
        }
 public static RemoveMemberRequest Deserialize(Stream stream, RemoveMemberRequest instance, long limit)
 {
     while (limit < 0L || stream.get_Position() < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else
         {
             int num2 = num;
             if (num2 != 10)
             {
                 if (num2 != 18)
                 {
                     if (num2 != 24)
                     {
                         Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                         uint field = key.Field;
                         if (field == 0u)
                         {
                             throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                         }
                         ProtocolParser.SkipKey(stream, key);
                     }
                     else
                     {
                         instance.Reason = ProtocolParser.ReadUInt32(stream);
                     }
                 }
                 else if (instance.MemberId == null)
                 {
                     instance.MemberId = EntityId.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.MemberId);
                 }
             }
             else if (instance.AgentId == null)
             {
                 instance.AgentId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.AgentId);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public static RemoveMemberRequest DeserializeLengthDelimited(Stream stream, RemoveMemberRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(RemoveMemberRequest.Deserialize(stream, instance, num));
        }
 public static void Serialize(Stream stream, RemoveMemberRequest instance)
 {
     if (instance.HasAgentId)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize());
         EntityId.Serialize(stream, instance.AgentId);
     }
     if (instance.MemberId == null)
     {
         throw new ArgumentNullException("MemberId", "Required by proto specification.");
     }
     stream.WriteByte(18);
     ProtocolParser.WriteUInt32(stream, instance.MemberId.GetSerializedSize());
     EntityId.Serialize(stream, instance.MemberId);
     if (instance.HasReason)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.Reason);
     }
 }
        public override bool Equals(object obj)
        {
            RemoveMemberRequest removeMemberRequest = obj as RemoveMemberRequest;

            if (removeMemberRequest == null)
            {
                return(false);
            }
            if (this.HasAgentId != removeMemberRequest.HasAgentId || this.HasAgentId && !this.AgentId.Equals(removeMemberRequest.AgentId))
            {
                return(false);
            }
            if (!this.MemberId.Equals(removeMemberRequest.MemberId))
            {
                return(false);
            }
            if (this.HasReason == removeMemberRequest.HasReason && (!this.HasReason || this.Reason.Equals(removeMemberRequest.Reason)))
            {
                return(true);
            }
            return(false);
        }
 public static RemoveMemberRequest Deserialize(Stream stream, RemoveMemberRequest instance, long limit)
 {
     while (true)
     {
         if (limit < (long)0 || stream.Position < limit)
         {
             int num = stream.ReadByte();
             if (num == -1)
             {
                 if (limit >= (long)0)
                 {
                     throw new EndOfStreamException();
                 }
                 break;
             }
             else if (num == 10)
             {
                 if (instance.AgentId != null)
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.AgentId);
                 }
                 else
                 {
                     instance.AgentId = EntityId.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num != 18)
             {
                 if (num == 24)
                 {
                     instance.Reason = ProtocolParser.ReadUInt32(stream);
                 }
                 else
                 {
                     Key key = ProtocolParser.ReadKey((byte)num, stream);
                     if (key.Field == 0)
                     {
                         throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                     }
                     ProtocolParser.SkipKey(stream, key);
                 }
             }
             else if (instance.MemberId != null)
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.MemberId);
             }
             else
             {
                 instance.MemberId = EntityId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static RemoveMemberRequest Deserialize(Stream stream, RemoveMemberRequest instance)
 {
     return(RemoveMemberRequest.Deserialize(stream, instance, (long)-1));
 }
 public void Deserialize(Stream stream)
 {
     RemoveMemberRequest.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            RemoveMemberRequest removeMemberRequest = obj as RemoveMemberRequest;

            return(removeMemberRequest != null && this.HasAgentId == removeMemberRequest.HasAgentId && (!this.HasAgentId || this.AgentId.Equals(removeMemberRequest.AgentId)) && this.MemberId.Equals(removeMemberRequest.MemberId) && this.HasReason == removeMemberRequest.HasReason && (!this.HasReason || this.Reason.Equals(removeMemberRequest.Reason)));
        }