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

namespace MyTelegram.Schema.Phone;

///<summary>
/// Contains info about a group call, and partial info about its participants.
/// See <a href="https://corefork.telegram.org/constructor/phone.groupCall" />
///</summary>
[TlObject(0x9e727aad)]
public sealed class TGroupCall : IGroupCall
{
    public uint ConstructorId => 0x9e727aad;
    ///<summary>
    /// Info about the group call
    /// See <a href="https://corefork.telegram.org/type/GroupCall" />
    ///</summary>
    public MyTelegram.Schema.IGroupCall Call { get; set; }

    ///<summary>
    /// A partial list of participants.
    ///</summary>
    public TVector<MyTelegram.Schema.IGroupCallParticipant> Participants { get; set; }

    ///<summary>
    /// Next offset to use when fetching the remaining participants using <a href="https://corefork.telegram.org/method/phone.getGroupParticipants">phone.getGroupParticipants</a>
    ///</summary>
    public string ParticipantsNextOffset { get; set; }

    ///<summary>
    /// Chats mentioned in the participants vector
    ///</summary>
    public TVector<MyTelegram.Schema.IChat> Chats { get; set; }

    ///<summary>
    /// Users mentioned in the participants vector
    ///</summary>
    public TVector<MyTelegram.Schema.IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Call = buffer.Read<MyTelegram.Schema.IGroupCall>();
        Participants = buffer.Read<TVector<MyTelegram.Schema.IGroupCallParticipant>>();
        ParticipantsNextOffset = buffer.ReadString();
        Chats = buffer.Read<TVector<MyTelegram.Schema.IChat>>();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
    }
}