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

namespace MyTelegram.Schema;

///<summary>
/// Default banned rights in a <a href="https://corefork.telegram.org/api/channel">normal chat</a> were updated
/// See <a href="https://corefork.telegram.org/constructor/updateChatDefaultBannedRights" />
///</summary>
[TlObject(0x54c01850)]
public sealed class TUpdateChatDefaultBannedRights : IUpdate
{
    public uint ConstructorId => 0x54c01850;
    ///<summary>
    /// The chat
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// New default banned rights
    /// See <a href="https://corefork.telegram.org/type/ChatBannedRights" />
    ///</summary>
    public MyTelegram.Schema.IChatBannedRights DefaultBannedRights { get; set; }

    ///<summary>
    /// Version
    ///</summary>
    public int Version { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        DefaultBannedRights = buffer.Read<MyTelegram.Schema.IChatBannedRights>();
        Version = buffer.ReadInt32();
    }
}