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

namespace MyTelegram.Schema.Channels;

///<summary>
/// Admins with <a href="https://corefork.telegram.org/constructor/chatAdminRights">ban_users admin rights »</a> may allow users that apply a certain number of <a href="https://corefork.telegram.org/api/boost">booosts »</a> to the group to bypass <a href="https://corefork.telegram.org/method/channels.toggleSlowMode">slow mode »</a> and <a href="https://corefork.telegram.org/api/rights#default-rights">other »</a> supergroup restrictions, see <a href="https://corefork.telegram.org/api/boost#bypass-slowmode-and-chat-restrictions">here »</a> for more info.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CHANNEL_INVALID The provided channel is invalid.
/// See <a href="https://corefork.telegram.org/method/channels.setBoostsToUnblockRestrictions" />
///</summary>
[TlObject(0xad399cee)]
public sealed class RequestSetBoostsToUnblockRestrictions : IRequest<MyTelegram.Schema.IUpdates>
{
    public uint ConstructorId => 0xad399cee;
    ///<summary>
    /// The supergroup.
    /// See <a href="https://corefork.telegram.org/type/InputChannel" />
    ///</summary>
    public MyTelegram.Schema.IInputChannel Channel { get; set; }

    ///<summary>
    /// The number of required boosts (1-8, 0 to disable).
    ///</summary>
    public int Boosts { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Channel = buffer.Read<MyTelegram.Schema.IInputChannel>();
        Boosts = buffer.ReadInt32();
    }
}
