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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Turn a <a href="https://corefork.telegram.org/api/channel#migration">basic group into a supergroup</a>
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CHANNELS_TOO_MUCH You have joined too many channels/supergroups.
/// 403 CHAT_ADMIN_REQUIRED You must be an admin in this chat to do this.
/// 400 CHAT_ID_INVALID The provided chat id is invalid.
/// 500 CHAT_INVALID Invalid chat.
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// See <a href="https://corefork.telegram.org/method/messages.migrateChat" />
///</summary>
[TlObject(0xa2875319)]
public sealed class RequestMigrateChat : IRequest<MyTelegram.Schema.IUpdates>
{
    public uint ConstructorId => 0xa2875319;
    ///<summary>
    /// <a href="https://corefork.telegram.org/api/channel#basic-groups">Basic group</a> to migrate
    ///</summary>
    public long ChatId { get; set; }

    public void ComputeFlag()
    {

    }

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

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