TLSharp/TeleSharp.TL/TL/TLInputMediaInvoice.cs

72 lines
2 KiB
C#
Raw Normal View History

2017-07-10 15:52:00 +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 00:36:50 +02:00
[TLObject(-1844103547)]
2017-07-10 15:52:00 +02:00
public class TLInputMediaInvoice : TLAbsInputMedia
{
public override int Constructor
{
get
{
return -1844103547;
}
}
2017-07-20 00:36:50 +02:00
public int flags { get; set; }
public string title { get; set; }
public string description { get; set; }
public TLInputWebDocument photo { get; set; }
public TLInvoice invoice { get; set; }
public byte[] payload { get; set; }
public string provider { get; set; }
public string start_param { get; set; }
2017-07-10 15:52:00 +02:00
2017-07-20 00:36:50 +02:00
public void ComputeFlags()
{
flags = 0;
flags = photo != null ? (flags | 1) : (flags & ~1);
2017-07-10 15:52:00 +02:00
2017-07-20 00:36:50 +02:00
}
2017-07-10 15:52:00 +02:00
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
2017-07-20 00:36:50 +02:00
title = StringUtil.Deserialize(br);
description = StringUtil.Deserialize(br);
if ((flags & 1) != 0)
photo = (TLInputWebDocument)ObjectUtils.DeserializeObject(br);
else
photo = null;
2017-07-10 15:52:00 +02:00
2017-07-20 00:36:50 +02:00
invoice = (TLInvoice)ObjectUtils.DeserializeObject(br);
payload = BytesUtil.Deserialize(br);
provider = StringUtil.Deserialize(br);
start_param = StringUtil.Deserialize(br);
2017-07-10 15:52:00 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
2017-07-20 00:36:50 +02:00
bw.Write(Constructor);
2017-07-10 15:52:00 +02:00
ComputeFlags();
2017-07-20 00:36:50 +02:00
bw.Write(flags);
StringUtil.Serialize(title, bw);
StringUtil.Serialize(description, bw);
if ((flags & 1) != 0)
ObjectUtils.SerializeObject(photo, bw);
ObjectUtils.SerializeObject(invoice, bw);
BytesUtil.Serialize(payload, bw);
StringUtil.Serialize(provider, bw);
StringUtil.Serialize(start_param, bw);
2017-07-10 15:52:00 +02:00
}
}
}