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

namespace MyTelegram.Schema;

///<summary>
/// Represents a channel post.
/// See <a href="https://corefork.telegram.org/constructor/mediaAreaChannelPost" />
///</summary>
[TlObject(0x770416af)]
public sealed class TMediaAreaChannelPost : IMediaArea
{
    public uint ConstructorId => 0x770416af;
    ///<summary>
    /// The size and location of the media area corresponding to the location sticker on top of the story media.
    /// See <a href="https://corefork.telegram.org/type/MediaAreaCoordinates" />
    ///</summary>
    public MyTelegram.Schema.IMediaAreaCoordinates Coordinates { get; set; }

    ///<summary>
    /// The channel that posted the message
    ///</summary>
    public long ChannelId { get; set; }

    ///<summary>
    /// ID of the channel message
    ///</summary>
    public int MsgId { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Coordinates = buffer.Read<MyTelegram.Schema.IMediaAreaCoordinates>();
        ChannelId = buffer.ReadInt64();
        MsgId = buffer.ReadInt32();
    }
}