TLSharp/TeleSharp.TL/TL/Account/TLRequestSendChangePhoneCode.cs

61 lines
1.6 KiB
C#
Raw Normal View History

2016-09-24 15:38:26 +02:00
using System.IO;
namespace TeleSharp.TL.Account
{
[TLObject(149257707)]
2016-09-24 15:38:26 +02:00
public class TLRequestSendChangePhoneCode : TLMethod
{
public override int Constructor
{
get
{
return 149257707;
}
}
public int flags { get; set; }
public bool allow_flashcall { get; set; }
public string phone_number { get; set; }
public bool? current_number { get; set; }
public Auth.TLSentCode Response { get; set; }
2016-09-24 15:38:26 +02:00
public void ComputeFlags()
{
flags = 0;
flags = allow_flashcall ? (flags | 1) : (flags & ~1);
flags = current_number != null ? (flags | 1) : (flags & ~1);
2016-09-24 15:38:26 +02:00
}
2016-09-24 15:38:26 +02:00
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
allow_flashcall = (flags & 1) != 0;
phone_number = StringUtil.Deserialize(br);
if ((flags & 1) != 0)
current_number = BoolUtil.Deserialize(br);
else
current_number = null;
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
2016-09-24 15:38:26 +02:00
ComputeFlags();
bw.Write(flags);
2016-09-24 15:38:26 +02:00
StringUtil.Serialize(phone_number, bw);
if ((flags & 1) != 0)
BoolUtil.Serialize(current_number.Value, bw);
2016-09-24 15:38:26 +02:00
}
public override void deserializeResponse(BinaryReader br)
{
Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br);
2016-09-24 15:38:26 +02:00
}
2016-09-24 15:38:26 +02:00
}
}