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

namespace MyTelegram.Schema;

///<summary>
/// Represents a <a href="https://corefork.telegram.org/api/stories#urls">URL media area</a>.
/// See <a href="https://corefork.telegram.org/constructor/mediaAreaUrl" />
///</summary>
[TlObject(0x37381085)]
public sealed class TMediaAreaUrl : IMediaArea
{
    public uint ConstructorId => 0x37381085;
    ///<summary>
    /// The size and location of the media area corresponding to the URL button on top of the story media.
    /// See <a href="https://corefork.telegram.org/type/MediaAreaCoordinates" />
    ///</summary>
    public MyTelegram.Schema.IMediaAreaCoordinates Coordinates { get; set; }

    ///<summary>
    /// URL to open when clicked.
    ///</summary>
    public string Url { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Coordinates = buffer.Read<MyTelegram.Schema.IMediaAreaCoordinates>();
        Url = buffer.ReadString();
    }
}