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

namespace MyTelegram.Schema;

///<summary>
/// Audio
/// See <a href="https://corefork.telegram.org/constructor/pageBlockAudio" />
///</summary>
[TlObject(0x804361ea)]
public sealed class TPageBlockAudio : IPageBlock
{
    public uint ConstructorId => 0x804361ea;
    ///<summary>
    /// Audio ID (to be fetched from the container <a href="https://corefork.telegram.org/constructor/page">page</a> constructor
    ///</summary>
    public long AudioId { get; set; }

    ///<summary>
    /// Audio caption
    /// See <a href="https://corefork.telegram.org/type/PageCaption" />
    ///</summary>
    public MyTelegram.Schema.IPageCaption Caption { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(AudioId);
        writer.Write(Caption);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        AudioId = buffer.ReadInt64();
        Caption = buffer.Read<MyTelegram.Schema.IPageCaption>();
    }
}