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

namespace MyTelegram.Schema;

///<summary>
/// See <a href="https://corefork.telegram.org/constructor/messageActionSuggestedPostRefund" />
///</summary>
[TlObject(0x69f916f8)]
public sealed class TMessageActionSuggestedPostRefund : IMessageAction
{
    public uint ConstructorId => 0x69f916f8;
    public int Flags { get; set; }
    public bool PayerInitiated { get; set; }

    public void ComputeFlag()
    {
        if (PayerInitiated) { Flags = Flags.SetBit(0); }
    }

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

    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Flags = buffer.ReadInt32();
        if (Flags.IsBitSet(0)) { PayerInitiated = true; }
    }
}