TLSharp/TeleSharp.TL/TL/Contacts/TLRequestGetTopPeers.cs
2017-04-13 13:38:01 +07:00

62 lines
1.8 KiB
C#

using System.IO;
namespace TeleSharp.TL.Contacts
{
[TLObject(-728224331)]
public class TLRequestGetTopPeers : TLMethod
{
public override int Constructor => -728224331;
public int flags { get; set; }
public bool correspondents { get; set; }
public bool bots_pm { get; set; }
public bool bots_inline { get; set; }
public bool groups { get; set; }
public bool channels { get; set; }
public int offset { get; set; }
public int limit { get; set; }
public int hash { get; set; }
public TLAbsTopPeers Response { get; set; }
public void ComputeFlags()
{
flags = 0;
flags = correspondents ? flags | 1 : flags & ~1;
flags = bots_pm ? flags | 2 : flags & ~2;
flags = bots_inline ? flags | 4 : flags & ~4;
flags = groups ? flags | 1024 : flags & ~1024;
flags = channels ? flags | 32768 : flags & ~32768;
}
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
correspondents = (flags & 1) != 0;
bots_pm = (flags & 2) != 0;
bots_inline = (flags & 4) != 0;
groups = (flags & 1024) != 0;
channels = (flags & 32768) != 0;
offset = br.ReadInt32();
limit = br.ReadInt32();
hash = br.ReadInt32();
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
ComputeFlags();
bw.Write(flags);
bw.Write(offset);
bw.Write(limit);
bw.Write(hash);
}
public override void deserializeResponse(BinaryReader br)
{
Response = (TLAbsTopPeers) ObjectUtils.DeserializeObject(br);
}
}
}