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

namespace MyTelegram.Schema.Messages;

///<summary>
/// The specified chat invite was replaced with another one
/// See <a href="https://corefork.telegram.org/constructor/messages.exportedChatInviteReplaced" />
///</summary>
[TlObject(0x222600ef)]
public sealed class TExportedChatInviteReplaced : IExportedChatInvite
{
    public uint ConstructorId => 0x222600ef;
    ///<summary>
    /// The replaced chat invite
    /// See <a href="https://corefork.telegram.org/type/ExportedChatInvite" />
    ///</summary>
    public MyTelegram.Schema.IExportedChatInvite Invite { get; set; }

    ///<summary>
    /// The invite that replaces the previous invite
    /// See <a href="https://corefork.telegram.org/type/ExportedChatInvite" />
    ///</summary>
    public MyTelegram.Schema.IExportedChatInvite NewInvite { get; set; }

    ///<summary>
    /// Mentioned users
    ///</summary>
    public TVector<MyTelegram.Schema.IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Invite);
        writer.Write(NewInvite);
        writer.Write(Users);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Invite = buffer.Read<MyTelegram.Schema.IExportedChatInvite>();
        NewInvite = buffer.Read<MyTelegram.Schema.IExportedChatInvite>();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
    }
}