TLSharp/TeleSharp.TL/TL/Account/TLRequestUpdateProfile.cs

62 lines
1.8 KiB
C#
Raw Normal View History

2016-09-24 15:38:26 +02:00
using System.IO;
2017-04-13 08:38:01 +02:00
2016-09-24 15:38:26 +02:00
namespace TeleSharp.TL.Account
{
2017-04-13 08:38:01 +02:00
[TLObject(2018596725)]
2016-09-24 15:38:26 +02:00
public class TLRequestUpdateProfile : TLMethod
{
2017-04-13 08:38:01 +02:00
public override int Constructor => 2018596725;
2016-09-24 15:38:26 +02:00
2017-04-13 08:38:01 +02:00
public int flags { get; set; }
public string first_name { get; set; }
public string last_name { get; set; }
public string about { get; set; }
public TLAbsUser Response { get; set; }
2016-09-24 15:38:26 +02:00
2017-04-13 08:38:01 +02:00
public void ComputeFlags()
{
flags = 0;
flags = first_name != null ? flags | 1 : flags & ~1;
flags = last_name != null ? flags | 2 : flags & ~2;
flags = about != null ? flags | 4 : flags & ~4;
}
2016-09-24 15:38:26 +02:00
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
2017-04-13 08:38:01 +02:00
if ((flags & 1) != 0)
first_name = StringUtil.Deserialize(br);
else
first_name = null;
if ((flags & 2) != 0)
last_name = StringUtil.Deserialize(br);
else
last_name = null;
if ((flags & 4) != 0)
about = StringUtil.Deserialize(br);
else
about = null;
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
2017-04-13 08:38:01 +02:00
bw.Write(Constructor);
2016-09-24 15:38:26 +02:00
ComputeFlags();
2017-04-13 08:38:01 +02:00
bw.Write(flags);
if ((flags & 1) != 0)
StringUtil.Serialize(first_name, bw);
if ((flags & 2) != 0)
StringUtil.Serialize(last_name, bw);
if ((flags & 4) != 0)
StringUtil.Serialize(about, bw);
2016-09-24 15:38:26 +02:00
}
2017-04-13 08:38:01 +02:00
public override void deserializeResponse(BinaryReader br)
{
Response = (TLAbsUser) ObjectUtils.DeserializeObject(br);
}
2016-09-24 15:38:26 +02:00
}
2017-04-13 08:38:01 +02:00
}