TLSharp/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs

76 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
{
2017-12-20 12:06:31 +01:00
[TLObject(-476700163)]
2016-09-24 15:38:26 +02:00
public class TLInputMediaUploadedDocument : TLAbsInputMedia
{
2017-12-20 12:06:31 +01:00
public TLVector<TLAbsDocumentAttribute> Attributes { get; set; }
public string Caption { get; set; }
2016-09-24 15:38:26 +02:00
public override int Constructor
{
get
{
2017-12-20 12:06:31 +01:00
return -476700163;
2016-09-24 15:38:26 +02:00
}
}
public TLAbsInputFile File { get; set; }
2017-12-20 12:06:31 +01:00
public int Flags { get; set; }
public string MimeType { get; set; }
2017-12-20 12:06:31 +01:00
public TLVector<TLAbsInputDocument> Stickers { get; set; }
2016-09-24 15:38:26 +02:00
2017-12-20 12:06:31 +01:00
public TLAbsInputFile Thumb { get; set; }
public int? TtlSeconds { 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();
File = (TLAbsInputFile)ObjectUtils.DeserializeObject(br);
2017-12-20 12:06:31 +01:00
if ((Flags & 4) != 0)
Thumb = (TLAbsInputFile)ObjectUtils.DeserializeObject(br);
else
Thumb = null;
MimeType = StringUtil.Deserialize(br);
Attributes = (TLVector<TLAbsDocumentAttribute>)ObjectUtils.DeserializeVector<TLAbsDocumentAttribute>(br);
Caption = StringUtil.Deserialize(br);
if ((Flags & 1) != 0)
Stickers = (TLVector<TLAbsInputDocument>)ObjectUtils.DeserializeVector<TLAbsInputDocument>(br);
else
Stickers = null;
2016-10-13 19:33:16 +02:00
2017-12-20 12:06:31 +01:00
if ((Flags & 2) != 0)
TtlSeconds = br.ReadInt32();
else
TtlSeconds = null;
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
bw.Write(Flags);
ObjectUtils.SerializeObject(File, bw);
2017-12-20 12:06:31 +01:00
if ((Flags & 4) != 0)
ObjectUtils.SerializeObject(Thumb, bw);
StringUtil.Serialize(MimeType, bw);
ObjectUtils.SerializeObject(Attributes, bw);
StringUtil.Serialize(Caption, bw);
if ((Flags & 1) != 0)
ObjectUtils.SerializeObject(Stickers, bw);
2017-12-20 12:06:31 +01:00
if ((Flags & 2) != 0)
bw.Write(TtlSeconds.Value);
2016-09-24 15:38:26 +02:00
}
}
}