TLSharp/TeleSharp.TL/TL/TLInputBotInlineResultDocument.cs

75 lines
2.1 KiB
C#
Raw Permalink Normal View History

2016-09-24 15:38:26 +02:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TeleSharp.TL;
namespace TeleSharp.TL
{
[TLObject(-459324)]
2016-09-24 15:38:26 +02:00
public class TLInputBotInlineResultDocument : TLAbsInputBotInlineResult
{
public override int Constructor
{
get
{
return -459324;
}
}
public int Flags { get; set; }
public string Id { get; set; }
public string Type { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public TLAbsInputDocument Document { get; set; }
public TLAbsInputBotInlineMessage SendMessage { get; set; }
2016-09-24 15:38:26 +02:00
public void ComputeFlags()
{
Flags = 0;
Flags = Title != null ? (Flags | 2) : (Flags & ~2);
Flags = Description != null ? (Flags | 4) : (Flags & ~4);
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();
Id = StringUtil.Deserialize(br);
Type = StringUtil.Deserialize(br);
if ((Flags & 2) != 0)
Title = StringUtil.Deserialize(br);
else
Title = null;
2016-09-24 15:38:26 +02:00
if ((Flags & 4) != 0)
Description = StringUtil.Deserialize(br);
else
Description = null;
2016-09-24 15:38:26 +02:00
Document = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br);
SendMessage = (TLAbsInputBotInlineMessage)ObjectUtils.DeserializeObject(br);
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);
StringUtil.Serialize(Id, bw);
StringUtil.Serialize(Type, bw);
if ((Flags & 2) != 0)
StringUtil.Serialize(Title, bw);
if ((Flags & 4) != 0)
StringUtil.Serialize(Description, bw);
ObjectUtils.SerializeObject(Document, bw);
ObjectUtils.SerializeObject(SendMessage, bw);
2016-09-24 15:38:26 +02:00
}
}
}