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

namespace MyTelegram.Schema;

///<summary>
/// New message in a private chat or in a <a href="https://core.telegram.org/api/channel#basic-groups">basic group</a>.
/// See <a href="https://corefork.telegram.org/constructor/updateNewMessage" />
///</summary>
[TlObject(0x1f2b0afd)]
public sealed class TUpdateNewMessage : IUpdate
{
    public uint ConstructorId => 0x1f2b0afd;
    ///<summary>
    /// Message
    /// See <a href="https://corefork.telegram.org/type/Message" />
    ///</summary>
    public MyTelegram.Schema.IMessage Message { get; set; }

    ///<summary>
    /// New quantity of actions in a message box
    ///</summary>
    public int Pts { get; set; }

    ///<summary>
    /// Number of generated events
    ///</summary>
    public int PtsCount { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Message);
        writer.Write(Pts);
        writer.Write(PtsCount);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Message = buffer.Read<MyTelegram.Schema.IMessage>();
        Pts = buffer.ReadInt32();
        PtsCount = buffer.ReadInt32();
    }
}