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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Changes the privacy of already sent <a href="https://corefork.telegram.org/api/reactions#paid-reactions">paid reactions</a> on a specific message.
/// See <a href="https://corefork.telegram.org/method/messages.togglePaidReactionPrivacy" />
///</summary>
[TlObject(0x435885b5)]
public sealed class RequestTogglePaidReactionPrivacy : IRequest<IBool>
{
    public uint ConstructorId => 0x435885b5;
    ///<summary>
    /// The channel
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// The ID of the message to which we sent the paid reactions
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// If true, makes the current anonymous in the top sender leaderboard for this message; otherwise, does the opposite.
    /// See <a href="https://corefork.telegram.org/type/PaidReactionPrivacy" />
    ///</summary>
    public MyTelegram.Schema.IPaidReactionPrivacy Private { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IInputPeer>();
        MsgId = buffer.ReadInt32();
        Private = buffer.Read<MyTelegram.Schema.IPaidReactionPrivacy>();
    }
}
