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

namespace MyTelegram.Schema;

///<summary>
/// Message entity representing a phone number.
/// See <a href="https://corefork.telegram.org/constructor/messageEntityPhone" />
///</summary>
[TlObject(0x9b69e34b)]
public sealed class TMessageEntityPhone : IMessageEntity
{
    public uint ConstructorId => 0x9b69e34b;
    ///<summary>
    /// Offset of message entity within message (in <a href="https://corefork.telegram.org/api/entities#entity-length">UTF-16 code units</a>)
    ///</summary>
    public int Offset { get; set; }

    ///<summary>
    /// Length of message entity within message (in <a href="https://corefork.telegram.org/api/entities#entity-length">UTF-16 code units</a>)
    ///</summary>
    public int Length { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Offset = buffer.ReadInt32();
        Length = buffer.ReadInt32();
    }
}