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
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
[TLObject(400266251)]
|
2016-09-24 15:38:26 +02:00
|
|
|
public class TLBotInlineMediaResult : TLAbsBotInlineResult
|
|
|
|
|
{
|
|
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return 400266251;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
public int Flags { get; set; }
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public string Type { get; set; }
|
|
|
|
|
public TLAbsPhoto Photo { get; set; }
|
|
|
|
|
public TLAbsDocument Document { get; set; }
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
public string Description { get; set; }
|
|
|
|
|
public TLAbsBotInlineMessage SendMessage { get; set; }
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = 0;
|
|
|
|
|
Flags = Photo != null ? (Flags | 1) : (Flags & ~1);
|
|
|
|
|
Flags = Document != null ? (Flags | 2) : (Flags & ~2);
|
|
|
|
|
Flags = Title != null ? (Flags | 4) : (Flags & ~4);
|
|
|
|
|
Flags = Description != null ? (Flags | 8) : (Flags & ~8);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
}
|
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();
|
|
|
|
|
Id = StringUtil.Deserialize(br);
|
|
|
|
|
Type = StringUtil.Deserialize(br);
|
|
|
|
|
if ((Flags & 1) != 0)
|
|
|
|
|
Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Photo = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 2) != 0)
|
|
|
|
|
Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Document = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 4) != 0)
|
|
|
|
|
Title = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Title = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 8) != 0)
|
|
|
|
|
Description = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Description = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
SendMessage = (TLAbsBotInlineMessage)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);
|
2016-09-24 15:38:26 +02:00
|
|
|
ComputeFlags();
|
2017-11-09 11:35:15 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|