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

namespace MyTelegram.Schema.Phone;

///<summary>
/// A list of peers that can be used to join a group call, presenting yourself as a specific user/channel.
/// See <a href="https://corefork.telegram.org/constructor/phone.joinAsPeers" />
///</summary>
[TlObject(0xafe5623f)]
public sealed class TJoinAsPeers : IJoinAsPeers
{
    public uint ConstructorId => 0xafe5623f;
    ///<summary>
    /// Peers
    ///</summary>
    public TVector<MyTelegram.Schema.IPeer> Peers { get; set; }

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

    ///<summary>
    /// Users mentioned in the peers 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(Peers);
        writer.Write(Chats);
        writer.Write(Users);
    }

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