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

using System.Reflection.PortableExecutable;

namespace MyTelegram.Schema.Channels.LayerN;

///<summary>
/// Represents a channel participant
/// See <a href="https://corefork.telegram.org/constructor/channels.channelParticipant" />
///</summary>
[TlObject(0xd0d9b163)]
public sealed class TChannelParticipant : IChannelParticipant
{
    public uint ConstructorId => 0xd0d9b163;
    ///<summary>
    /// The channel participant
    ///</summary>
    public MyTelegram.Schema.IChannelParticipant Participant { get; set; }

    public TVector<IChat> Chats { get; set; }

    ///<summary>
    /// Users
    ///</summary>
    public TVector<IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Participant = buffer.Read<MyTelegram.Schema.IChannelParticipant>();
        Users = buffer.Read<TVector<IUser>>();
    }
}