TLSharp/TeleSharp.TL/TL/TLInputMediaPhotoExternal.cs
2017-11-09 01:37:23 -08:00

54 lines
1.3 KiB
C#

using System.IO;
namespace TeleSharp.TL
{
[TLObject(153267905)]
public class TLInputMediaPhotoExternal : TLAbsInputMedia
{
public override int Constructor
{
get
{
return 153267905;
}
}
public int flags { get; set; }
public string url { get; set; }
public string caption { get; set; }
public int? ttl_seconds { get; set; }
public void ComputeFlags()
{
flags = 0;
flags = ttl_seconds != null ? (flags | 1) : (flags & ~1);
}
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
url = StringUtil.Deserialize(br);
caption = StringUtil.Deserialize(br);
if ((flags & 1) != 0)
ttl_seconds = br.ReadInt32();
else
ttl_seconds = null;
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
ComputeFlags();
bw.Write(flags);
StringUtil.Serialize(url, bw);
StringUtil.Serialize(caption, bw);
if ((flags & 1) != 0)
bw.Write(ttl_seconds.Value);
}
}
}