2016-09-24 15:38:26 +02:00
|
|
|
using System.IO;
|
2017-12-20 12:06:31 +01:00
|
|
|
|
2016-09-24 15:38:26 +02:00
|
|
|
namespace TeleSharp.TL.Auth
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
[TLObject(-2035355412)]
|
2016-09-24 15:38:26 +02:00
|
|
|
public class TLRequestSendCode : TLMethod
|
|
|
|
|
{
|
2017-12-20 12:06:31 +01:00
|
|
|
public bool AllowFlashcall { get; set; }
|
|
|
|
|
|
|
|
|
|
public string ApiHash { get; set; }
|
|
|
|
|
|
|
|
|
|
public int ApiId { get; set; }
|
|
|
|
|
|
2016-09-24 15:38:26 +02:00
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return -2035355412;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-20 12:06:31 +01:00
|
|
|
public bool? CurrentNumber { get; set; }
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
public int Flags { get; set; }
|
2017-12-20 12:06:31 +01:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
public string PhoneNumber { get; set; }
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-12-20 12:06:31 +01:00
|
|
|
public Auth.TLSentCode Response { get; set; }
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
|
|
|
|
}
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
public override void DeserializeBody(BinaryReader br)
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = br.ReadInt32();
|
|
|
|
|
AllowFlashcall = (Flags & 1) != 0;
|
|
|
|
|
PhoneNumber = StringUtil.Deserialize(br);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
CurrentNumber = BoolUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
CurrentNumber = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
ApiId = br.ReadInt32();
|
|
|
|
|
ApiHash = StringUtil.Deserialize(br);
|
2017-12-20 12:06:31 +01:00
|
|
|
}
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-12-20 12:06:31 +01:00
|
|
|
public override void DeserializeResponse(BinaryReader br)
|
|
|
|
|
{
|
|
|
|
|
Response = (Auth.TLSentCode)ObjectUtils.DeserializeObject(br);
|
2016-09-24 15:38:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SerializeBody(BinaryWriter bw)
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
bw.Write(Constructor);
|
2017-11-09 11:35:15 +01:00
|
|
|
bw.Write(Flags);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
StringUtil.Serialize(PhoneNumber, bw);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
BoolUtil.Serialize(CurrentNumber.Value, bw);
|
|
|
|
|
bw.Write(ApiId);
|
|
|
|
|
StringUtil.Serialize(ApiHash, bw);
|
2017-07-20 04:07:24 +02:00
|
|
|
}
|
2016-09-24 15:38:26 +02:00
|
|
|
}
|
|
|
|
|
}
|