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

namespace MyTelegram.Schema;

///<summary>
/// Styled text with <a href="https://corefork.telegram.org/api/entities">message entities</a>
/// See <a href="https://corefork.telegram.org/constructor/textWithEntities" />
///</summary>
[TlObject(0x751f3146)]
public sealed class TTextWithEntities : ITextWithEntities
{
    public uint ConstructorId => 0x751f3146;
    ///<summary>
    /// Text
    ///</summary>
    public string Text { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/entities">Message entities for styled text</a>
    ///</summary>
    public TVector<MyTelegram.Schema.IMessageEntity> Entities { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Text = buffer.ReadString();
        Entities = buffer.Read<TVector<MyTelegram.Schema.IMessageEntity>>();
    }
}