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

namespace MyTelegram.Schema.Auth;

///<summary>
/// Login as a bot
/// <para>Possible errors</para>
/// Code Type Description
/// 400 ACCESS_TOKEN_EXPIRED Access token expired.
/// 400 ACCESS_TOKEN_INVALID Access token invalid.
/// 400 API_ID_INVALID API ID invalid.
/// 400 API_ID_PUBLISHED_FLOOD This API id was published somewhere, you can't use it now.
/// See <a href="https://corefork.telegram.org/method/auth.importBotAuthorization" />
///</summary>
[TlObject(0x67a3ff2c)]
public sealed class RequestImportBotAuthorization : IRequest<MyTelegram.Schema.Auth.IAuthorization>
{
    public uint ConstructorId => 0x67a3ff2c;
    ///<summary>
    /// Reserved for future use
    ///</summary>
    public int Flags { get; set; }

    ///<summary>
    /// Application identifier (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)
    ///</summary>
    public int ApiId { get; set; }

    ///<summary>
    /// Application identifier hash (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)
    ///</summary>
    public string ApiHash { get; set; }

    ///<summary>
    /// Bot token (see <a href="https://corefork.telegram.org/bots">bots</a>)
    ///</summary>
    public string BotAuthToken { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Flags);
        writer.Write(ApiId);
        writer.Write(ApiHash);
        writer.Write(BotAuthToken);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Flags = buffer.ReadInt32();
        ApiId = buffer.ReadInt32();
        ApiHash = buffer.ReadString();
        BotAuthToken = buffer.ReadString();
    }
}
