TLSharp/TeleSharp.TL/TL/TLBotInlineMediaResult.cs

82 lines
2.2 KiB
C#
Raw Normal View History

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
{
[TLObject(400266251)]
2016-09-24 15:38:26 +02:00
public class TLBotInlineMediaResult : TLAbsBotInlineResult
{
public override int Constructor
{
get
{
return 400266251;
}
}
2017-12-20 12:06:31 +01:00
public string Description { get; set; }
public TLAbsDocument Document { get; set; }
public int Flags { get; set; }
2017-12-20 12:06:31 +01:00
public string Id { get; set; }
2017-12-20 12:06:31 +01:00
public TLAbsPhoto Photo { get; set; }
2017-12-20 12:06:31 +01:00
public TLAbsBotInlineMessage SendMessage { get; set; }
2016-09-24 15:38:26 +02:00
2017-12-20 12:06:31 +01:00
public string Title { get; set; }
public string Type { get; set; }
2016-09-24 15:38:26 +02:00
public void ComputeFlags()
{
}
2016-09-24 15:38:26 +02:00
public override void DeserializeBody(BinaryReader br)
{
Flags = br.ReadInt32();
Id = StringUtil.Deserialize(br);
Type = StringUtil.Deserialize(br);
if ((Flags & 1) != 0)
Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br);
else
Photo = null;
2016-09-24 15:38:26 +02:00
if ((Flags & 2) != 0)
Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br);
else
Document = null;
2016-09-24 15:38:26 +02:00
if ((Flags & 4) != 0)
Title = StringUtil.Deserialize(br);
else
Title = null;
2016-09-24 15:38:26 +02:00
if ((Flags & 8) != 0)
Description = StringUtil.Deserialize(br);
else
Description = null;
2016-09-24 15:38:26 +02:00
SendMessage = (TLAbsBotInlineMessage)ObjectUtils.DeserializeObject(br);
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
bw.Write(Flags);
StringUtil.Serialize(Id, bw);
StringUtil.Serialize(Type, bw);
if ((Flags & 1) != 0)
ObjectUtils.SerializeObject(Photo, bw);
if ((Flags & 2) != 0)
ObjectUtils.SerializeObject(Document, bw);
if ((Flags & 4) != 0)
StringUtil.Serialize(Title, bw);
if ((Flags & 8) != 0)
StringUtil.Serialize(Description, bw);
ObjectUtils.SerializeObject(SendMessage, bw);
2016-09-24 15:38:26 +02:00
}
}
}