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

namespace MyTelegram.Schema.Contacts;

///<summary>
/// Info on successfully imported contacts.
/// See <a href="https://corefork.telegram.org/constructor/contacts.importedContacts" />
///</summary>
[TlObject(0x77d01c3b)]
public sealed class TImportedContacts : IImportedContacts
{
    public uint ConstructorId => 0x77d01c3b;
    ///<summary>
    /// List of successfully imported contacts
    ///</summary>
    public TVector<MyTelegram.Schema.IImportedContact> Imported { get; set; }

    ///<summary>
    /// Popular contacts
    ///</summary>
    public TVector<MyTelegram.Schema.IPopularContact> PopularInvites { get; set; }

    ///<summary>
    /// List of contact ids that could not be imported due to system limitation and will need to be imported at a later date.
    ///</summary>
    public TVector<long> RetryContacts { get; set; }

    ///<summary>
    /// List of 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(Imported);
        writer.Write(PopularInvites);
        writer.Write(RetryContacts);
        writer.Write(Users);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Imported = buffer.Read<TVector<MyTelegram.Schema.IImportedContact>>();
        PopularInvites = buffer.Read<TVector<MyTelegram.Schema.IPopularContact>>();
        RetryContacts = buffer.Read<TVector<long>>();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
    }
}