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

namespace MyTelegram.Schema;

///<summary>
/// Top peer
/// See <a href="https://corefork.telegram.org/constructor/topPeer" />
///</summary>
[TlObject(0xedcdc05b)]
public sealed class TTopPeer : ITopPeer
{
    public uint ConstructorId => 0xedcdc05b;
    ///<summary>
    /// Peer
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// Rating as computed in <a href="https://corefork.telegram.org/api/top-rating">top peer rating »</a>
    ///</summary>
    public double Rating { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        Rating = buffer.ReadDouble();
    }
}