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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Clear recent stickers
/// See <a href="https://corefork.telegram.org/method/messages.clearRecentStickers" />
///</summary>
[TlObject(0x8999602d)]
public sealed class RequestClearRecentStickers : IRequest<IBool>
{
    public uint ConstructorId => 0x8999602d;
    ///<summary>
    /// Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a>
    ///</summary>
    public int Flags { get; set; }

    ///<summary>
    /// Set this flag to clear the list of stickers recently attached to photo or video files
    /// See <a href="https://corefork.telegram.org/type/true" />
    ///</summary>
    public bool Attached { get; set; }

    public void ComputeFlag()
    {
        if (Attached) { 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)) { Attached = true; }
    }
}
