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

namespace MyTelegram.Schema;

///<summary>
/// A webpage preview of a link in a <a href="https://corefork.telegram.org/api/channel">channel/supergroup</a> message was generated
/// See <a href="https://corefork.telegram.org/constructor/updateChannelWebPage" />
///</summary>
[TlObject(0x2f2ba99f)]
public sealed class TUpdateChannelWebPage : IUpdate
{
    public uint ConstructorId => 0x2f2ba99f;
    ///<summary>
    /// <a href="https://corefork.telegram.org/api/channel">Channel/supergroup</a> ID
    ///</summary>
    public long ChannelId { get; set; }

    ///<summary>
    /// Generated webpage preview
    /// See <a href="https://corefork.telegram.org/type/WebPage" />
    ///</summary>
    public MyTelegram.Schema.IWebPage Webpage { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/updates">Event count after generation</a>
    ///</summary>
    public int Pts { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/updates">Number of events that were generated</a>
    ///</summary>
    public int PtsCount { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(ChannelId);
        writer.Write(Webpage);
        writer.Write(Pts);
        writer.Write(PtsCount);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        ChannelId = buffer.ReadInt64();
        Webpage = buffer.Read<MyTelegram.Schema.IWebPage>();
        Pts = buffer.ReadInt32();
        PtsCount = buffer.ReadInt32();
    }
}