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(750510426)]
|
2016-09-24 15:38:26 +02:00
|
|
|
public class TLInputBotInlineResult : TLAbsInputBotInlineResult
|
|
|
|
|
{
|
|
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return 750510426;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
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 string Url { get; set; }
|
|
|
|
|
public string ThumbUrl { get; set; }
|
|
|
|
|
public string ContentUrl { get; set; }
|
|
|
|
|
public string ContentType { get; set; }
|
|
|
|
|
public int? W { get; set; }
|
|
|
|
|
public int? H { get; set; }
|
|
|
|
|
public int? Duration { get; set; }
|
|
|
|
|
public TLAbsInputBotInlineMessage SendMessage { get; set; }
|
2017-07-20 04:07:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
2017-11-09 11:35:15 +01:00
|
|
|
Flags = 0;
|
|
|
|
|
Flags = Title != null ? (Flags | 2) : (Flags & ~2);
|
|
|
|
|
Flags = Description != null ? (Flags | 4) : (Flags & ~4);
|
|
|
|
|
Flags = Url != null ? (Flags | 8) : (Flags & ~8);
|
|
|
|
|
Flags = ThumbUrl != null ? (Flags | 16) : (Flags & ~16);
|
|
|
|
|
Flags = ContentUrl != null ? (Flags | 32) : (Flags & ~32);
|
|
|
|
|
Flags = ContentType != null ? (Flags | 32) : (Flags & ~32);
|
|
|
|
|
Flags = W != null ? (Flags | 64) : (Flags & ~64);
|
|
|
|
|
Flags = H != null ? (Flags | 64) : (Flags & ~64);
|
|
|
|
|
Flags = Duration != null ? (Flags | 128) : (Flags & ~128);
|
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 & 2) != 0)
|
|
|
|
|
Title = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Title = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 4) != 0)
|
|
|
|
|
Description = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Description = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 8) != 0)
|
|
|
|
|
Url = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Url = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 16) != 0)
|
|
|
|
|
ThumbUrl = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
ThumbUrl = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 32) != 0)
|
|
|
|
|
ContentUrl = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
ContentUrl = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 32) != 0)
|
|
|
|
|
ContentType = StringUtil.Deserialize(br);
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
ContentType = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 64) != 0)
|
|
|
|
|
W = br.ReadInt32();
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
W = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 64) != 0)
|
|
|
|
|
H = br.ReadInt32();
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
H = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
if ((Flags & 128) != 0)
|
|
|
|
|
Duration = br.ReadInt32();
|
2017-07-20 04:07:24 +02:00
|
|
|
else
|
2017-11-09 11:35:15 +01:00
|
|
|
Duration = null;
|
2017-07-20 04:07:24 +02:00
|
|
|
|
2017-11-09 11:35:15 +01:00
|
|
|
SendMessage = (TLAbsInputBotInlineMessage)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 & 2) != 0)
|
|
|
|
|
StringUtil.Serialize(Title, bw);
|
|
|
|
|
if ((Flags & 4) != 0)
|
|
|
|
|
StringUtil.Serialize(Description, bw);
|
|
|
|
|
if ((Flags & 8) != 0)
|
|
|
|
|
StringUtil.Serialize(Url, bw);
|
|
|
|
|
if ((Flags & 16) != 0)
|
|
|
|
|
StringUtil.Serialize(ThumbUrl, bw);
|
|
|
|
|
if ((Flags & 32) != 0)
|
|
|
|
|
StringUtil.Serialize(ContentUrl, bw);
|
|
|
|
|
if ((Flags & 32) != 0)
|
|
|
|
|
StringUtil.Serialize(ContentType, bw);
|
|
|
|
|
if ((Flags & 64) != 0)
|
|
|
|
|
bw.Write(W.Value);
|
|
|
|
|
if ((Flags & 64) != 0)
|
|
|
|
|
bw.Write(H.Value);
|
|
|
|
|
if ((Flags & 128) != 0)
|
|
|
|
|
bw.Write(Duration.Value);
|
|
|
|
|
ObjectUtils.SerializeObject(SendMessage, bw);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|