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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Changes chat name and sends a service message on it.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CHAT_ADMIN_REQUIRED You must be an admin in this chat to do this.
/// 400 CHAT_ID_INVALID The provided chat id is invalid.
/// 400 CHAT_NOT_MODIFIED No changes were made to chat information because the new information you passed is identical to the current information.
/// 400 CHAT_TITLE_EMPTY No chat title provided.
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// See <a href="https://corefork.telegram.org/method/messages.editChatTitle" />
///</summary>
[TlObject(0x73783ffd)]
public sealed class RequestEditChatTitle : IRequest<MyTelegram.Schema.IUpdates>
{
    public uint ConstructorId => 0x73783ffd;
    ///<summary>
    /// Chat ID
    ///</summary>
    public long ChatId { get; set; }

    ///<summary>
    /// New chat name, different from the old one
    ///</summary>
    public string Title { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        ChatId = buffer.ReadInt64();
        Title = buffer.ReadString();
    }
}
