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

namespace MyTelegram.Schema;

///<summary>
/// Link
/// See <a href="https://corefork.telegram.org/constructor/textUrl" />
///</summary>
[TlObject(0x3c2884c1)]
public sealed class TTextUrl : IRichText
{
    public uint ConstructorId => 0x3c2884c1;
    ///<summary>
    /// Text of link
    /// See <a href="https://corefork.telegram.org/type/RichText" />
    ///</summary>
    public MyTelegram.Schema.IRichText Text { get; set; }

    ///<summary>
    /// Webpage HTTP URL
    ///</summary>
    public string Url { get; set; }

    ///<summary>
    /// If a preview was already generated for the page, the page ID
    ///</summary>
    public long WebpageId { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Text);
        writer.Write(Url);
        writer.Write(WebpageId);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Text = buffer.Read<MyTelegram.Schema.IRichText>();
        Url = buffer.ReadString();
        WebpageId = buffer.ReadInt64();
    }
}