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

namespace MyTelegram.Schema;

///<summary>
/// Exported <a href="https://corefork.telegram.org/api/links#chat-folder-links">chat folder deep link »</a>.
/// See <a href="https://corefork.telegram.org/constructor/exportedChatlistInvite" />
///</summary>
[TlObject(0xc5181ac)]
public sealed class TExportedChatlistInvite : IExportedChatlistInvite
{
    public uint ConstructorId => 0xc5181ac;
    ///<summary>
    /// Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a>
    ///</summary>
    public int Flags { get; set; }

    ///<summary>
    /// Name of the link
    ///</summary>
    public string Title { get; set; }

    ///<summary>
    /// The <a href="https://corefork.telegram.org/api/links#chat-folder-links">chat folder deep link »</a>.
    ///</summary>
    public string Url { get; set; }

    ///<summary>
    /// Peers to import
    ///</summary>
    public TVector<MyTelegram.Schema.IPeer> Peers { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Flags);
        writer.Write(Title);
        writer.Write(Url);
        writer.Write(Peers);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Flags = buffer.ReadInt32();
        Title = buffer.ReadString();
        Url = buffer.ReadString();
        Peers = buffer.Read<TVector<MyTelegram.Schema.IPeer>>();
    }
}