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

namespace MyTelegram.Schema.Help;

///<summary>
/// Internal use
/// <para>Possible errors</para>
/// Code Type Description
/// 400 ENTITY_BOUNDS_INVALID A specified <a href="https://corefork.telegram.org/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="https://corefork.telegram.org/api/entities#entity-length">here&nbsp;»</a> for info on how to properly compute the entity offset/length.
/// 403 USER_INVALID Invalid user provided.
/// See <a href="https://corefork.telegram.org/method/help.editUserInfo" />
///</summary>
[TlObject(0x66b91b70)]
public sealed class RequestEditUserInfo : IRequest<MyTelegram.Schema.Help.IUserInfo>
{
    public uint ConstructorId => 0x66b91b70;
    ///<summary>
    /// User
    /// See <a href="https://corefork.telegram.org/type/InputUser" />
    ///</summary>
    public MyTelegram.Schema.IInputUser UserId { get; set; }

    ///<summary>
    /// Message
    ///</summary>
    public string Message { 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(UserId);
        writer.Write(Message);
        writer.Write(Entities);
    }

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