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

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

            UpdateChannelCountRequest.DeserializeLengthDelimited(stream, updateChannelCountRequest);
            return(updateChannelCountRequest);
        }
 public static UpdateChannelCountRequest Deserialize(Stream stream, UpdateChannelCountRequest 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 != 16)
                 {
                     if (num2 != 26)
                     {
                         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 if (instance.ChannelId == null)
                     {
                         instance.ChannelId = EntityId.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         EntityId.DeserializeLengthDelimited(stream, instance.ChannelId);
                     }
                 }
                 else
                 {
                     instance.ReservationToken = ProtocolParser.ReadUInt64(stream);
                 }
             }
             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 UpdateChannelCountRequest DeserializeLengthDelimited(Stream stream, UpdateChannelCountRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(UpdateChannelCountRequest.Deserialize(stream, instance, num));
        }
 public static void Serialize(Stream stream, UpdateChannelCountRequest instance)
 {
     if (instance.AgentId == null)
     {
         throw new ArgumentNullException("AgentId", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize());
     EntityId.Serialize(stream, instance.AgentId);
     if (instance.HasReservationToken)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt64(stream, instance.ReservationToken);
     }
     if (instance.ChannelId == null)
     {
         throw new ArgumentNullException("ChannelId", "Required by proto specification.");
     }
     stream.WriteByte(26);
     ProtocolParser.WriteUInt32(stream, instance.ChannelId.GetSerializedSize());
     EntityId.Serialize(stream, instance.ChannelId);
 }
        public override bool Equals(object obj)
        {
            UpdateChannelCountRequest updateChannelCountRequest = obj as UpdateChannelCountRequest;

            if (updateChannelCountRequest == null)
            {
                return(false);
            }
            if (!this.AgentId.Equals(updateChannelCountRequest.AgentId))
            {
                return(false);
            }
            if (this.HasReservationToken != updateChannelCountRequest.HasReservationToken || this.HasReservationToken && !this.ReservationToken.Equals(updateChannelCountRequest.ReservationToken))
            {
                return(false);
            }
            if (!this.ChannelId.Equals(updateChannelCountRequest.ChannelId))
            {
                return(false);
            }
            return(true);
        }
 public static UpdateChannelCountRequest Deserialize(Stream stream, UpdateChannelCountRequest instance)
 {
     return(UpdateChannelCountRequest.Deserialize(stream, instance, (long)-1));
 }
 public void Deserialize(Stream stream)
 {
     UpdateChannelCountRequest.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            UpdateChannelCountRequest updateChannelCountRequest = obj as UpdateChannelCountRequest;

            return(updateChannelCountRequest != null && this.AgentId.Equals(updateChannelCountRequest.AgentId) && this.HasReservationToken == updateChannelCountRequest.HasReservationToken && (!this.HasReservationToken || this.ReservationToken.Equals(updateChannelCountRequest.ReservationToken)) && this.ChannelId.Equals(updateChannelCountRequest.ChannelId));
        }