// <auto-generated/>
// ReSharper disable All

namespace MyTelegram.Schema;

///<summary>
/// You <a href="https://corefork.telegram.org/api/paid-media">bought a paid media »</a>: this update contains the revealed media.
/// See <a href="https://corefork.telegram.org/constructor/updateMessageExtendedMedia" />
///</summary>
[TlObject(0xd5a41724)]
public sealed class TUpdateMessageExtendedMedia : IUpdate
{
    public uint ConstructorId => 0xd5a41724;
    ///<summary>
    /// Peer where the paid media was posted
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// ID of the message containing the paid media
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// Revealed media, contains only <a href="https://corefork.telegram.org/constructor/messageExtendedMedia">messageExtendedMedia</a> constructors.
    ///</summary>
    public TVector<MyTelegram.Schema.IMessageExtendedMedia> ExtendedMedia { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Peer);
        writer.Write(MsgId);
        writer.Write(ExtendedMedia);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        MsgId = buffer.ReadInt32();
        ExtendedMedia = buffer.Read<TVector<MyTelegram.Schema.IMessageExtendedMedia>>();
    }
}