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

namespace MyTelegram.Schema;

///<summary>
/// Chat admin
/// See <a href="https://corefork.telegram.org/constructor/chatParticipantAdmin" />
///</summary>
[TlObject(0xa0933f5b)]
public sealed class TChatParticipantAdmin : IChatParticipant
{
    public uint ConstructorId => 0xa0933f5b;
    ///<summary>
    /// ID of a group member that is admin
    ///</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 when the user was added
    ///</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();
    }
}