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

namespace MyTelegram.Schema.Chatlists;

///<summary>
/// Updated info about a <a href="https://corefork.telegram.org/api/links#chat-folder-links">chat folder deep link »</a> we already imported.
/// See <a href="https://corefork.telegram.org/constructor/chatlists.chatlistInviteAlready" />
///</summary>
[TlObject(0xfa87f659)]
public sealed class TChatlistInviteAlready : IChatlistInvite
{
    public uint ConstructorId => 0xfa87f659;
    ///<summary>
    /// ID of the imported folder
    ///</summary>
    public int FilterId { get; set; }

    ///<summary>
    /// New peers to be imported
    ///</summary>
    public TVector<MyTelegram.Schema.IPeer> MissingPeers { get; set; }

    ///<summary>
    /// Peers that were already imported
    ///</summary>
    public TVector<MyTelegram.Schema.IPeer> AlreadyPeers { get; set; }

    ///<summary>
    /// Related chat information
    ///</summary>
    public TVector<MyTelegram.Schema.IChat> Chats { get; set; }

    ///<summary>
    /// Related user information
    ///</summary>
    public TVector<MyTelegram.Schema.IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(FilterId);
        writer.Write(MissingPeers);
        writer.Write(AlreadyPeers);
        writer.Write(Chats);
        writer.Write(Users);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        FilterId = buffer.ReadInt32();
        MissingPeers = buffer.Read<TVector<MyTelegram.Schema.IPeer>>();
        AlreadyPeers = buffer.Read<TVector<MyTelegram.Schema.IPeer>>();
        Chats = buffer.Read<TVector<MyTelegram.Schema.IChat>>();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
    }
}