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

namespace MyTelegram.Schema;

///<summary>
/// New group member.
/// See <a href="https://corefork.telegram.org/constructor/updateChatParticipantAdd" />
///</summary>
[TlObject(0x3dda5451)]
public sealed class TUpdateChatParticipantAdd : IUpdate
{
    public uint ConstructorId => 0x3dda5451;
    ///<summary>
    /// Group ID
    ///</summary>
    public long ChatId { get; set; }

    ///<summary>
    /// ID of the new member
    ///</summary>
    public long UserId { get; set; }

    ///<summary>
    /// ID of the user, who added member to the group
    ///</summary>
    public long InviterId { get; set; }

    ///<summary>
    /// When was the participant added
    ///</summary>
    public int Date { get; set; }

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

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(ChatId);
        writer.Write(UserId);
        writer.Write(InviterId);
        writer.Write(Date);
        writer.Write(Version);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        ChatId = buffer.ReadInt64();
        UserId = buffer.ReadInt64();
        InviterId = buffer.ReadInt64();
        Date = buffer.ReadInt32();
        Version = buffer.ReadInt32();
    }
}