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

namespace MyTelegram.Schema;

///<summary>
/// Group member.
/// See <a href="https://corefork.telegram.org/constructor/chatParticipant" />
///</summary>
[TlObject(0xc02d4007)]
public sealed class TChatParticipant : IChatParticipant
{
    public uint ConstructorId => 0xc02d4007;
    ///<summary>
    /// Member user ID
    ///</summary>
    public long UserId { get; set; }

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

    ///<summary>
    /// Date added to the group
    ///</summary>
    public int Date { get; set; }

    public void ComputeFlag()
    {

    }

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

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