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

namespace MyTelegram.Schema;

///<summary>
/// Someone has requested to join a chat or channel (bots only, users will receive an <a href="https://corefork.telegram.org/constructor/updatePendingJoinRequests">updatePendingJoinRequests</a>, instead)
/// See <a href="https://corefork.telegram.org/constructor/updateBotChatInviteRequester" />
///</summary>
[TlObject(0x11dfa986)]
public sealed class TUpdateBotChatInviteRequester : IUpdate
{
    public uint ConstructorId => 0x11dfa986;
    ///<summary>
    /// The chat or channel in question
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// When was the <a href="https://corefork.telegram.org/api/invites#join-requests">join request »</a> made
    ///</summary>
    public int Date { get; set; }

    ///<summary>
    /// The user ID that is asking to join the chat or channel
    ///</summary>
    public long UserId { get; set; }

    ///<summary>
    /// Bio of the user
    ///</summary>
    public string About { get; set; }

    ///<summary>
    /// Chat invite link that was used by the user to send the <a href="https://corefork.telegram.org/api/invites#join-requests">join request »</a>
    /// See <a href="https://corefork.telegram.org/type/ExportedChatInvite" />
    ///</summary>
    public MyTelegram.Schema.IExportedChatInvite Invite { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/updates">QTS</a> event sequence identifier
    ///</summary>
    public int Qts { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Peer);
        writer.Write(Date);
        writer.Write(UserId);
        writer.Write(About);
        writer.Write(Invite);
        writer.Write(Qts);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        Date = buffer.ReadInt32();
        UserId = buffer.ReadInt64();
        About = buffer.ReadString();
        Invite = buffer.Read<MyTelegram.Schema.IExportedChatInvite>();
        Qts = buffer.ReadInt32();
    }
}