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

namespace MyTelegram.Schema;

///<summary>
/// An <a href="https://instantview.telegram.org/">instant view</a> webpage preview was generated
/// See <a href="https://corefork.telegram.org/constructor/updateWebPage" />
///</summary>
[TlObject(0x7f891213)]
public sealed class TUpdateWebPage : IUpdate
{
    public uint ConstructorId => 0x7f891213;
    ///<summary>
    /// 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(Webpage);
        writer.Write(Pts);
        writer.Write(PtsCount);
    }

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