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

namespace MyTelegram.Schema.Channels;

///<summary>
/// Represents multiple channel participants
/// See <a href="https://corefork.telegram.org/constructor/channels.channelParticipants" />
///</summary>
[TlObject(0x9ab0feaf)]
public sealed class TChannelParticipants : IChannelParticipants
{
    public uint ConstructorId => 0x9ab0feaf;
    ///<summary>
    /// Total number of participants that correspond to the given query
    ///</summary>
    public int Count { get; set; }

    ///<summary>
    /// Participants
    ///</summary>
    public TVector<MyTelegram.Schema.IChannelParticipant> Participants { get; set; }

    ///<summary>
    /// Mentioned chats
    ///</summary>
    public TVector<MyTelegram.Schema.IChat> Chats { get; set; }

    ///<summary>
    /// Users mentioned in participant info
    ///</summary>
    public TVector<MyTelegram.Schema.IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Count);
        writer.Write(Participants);
        writer.Write(Chats);
        writer.Write(Users);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Count = buffer.ReadInt32();
        Participants = buffer.Read<TVector<MyTelegram.Schema.IChannelParticipant>>();
        Chats = buffer.Read<TVector<MyTelegram.Schema.IChat>>();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
    }
}