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

namespace MyTelegram.Schema.Account;

///<summary>
/// Returns a Telegram Passport authorization form for sharing data with a service
/// <para>Possible errors</para>
/// Code Type Description
/// 400 BOT_INVALID This is not a valid bot.
/// 400 PUBLIC_KEY_REQUIRED A public key is required.
/// See <a href="https://corefork.telegram.org/method/account.getAuthorizationForm" />
///</summary>
[TlObject(0xa929597a)]
public sealed class RequestGetAuthorizationForm : IRequest<MyTelegram.Schema.Account.IAuthorizationForm>
{
    public uint ConstructorId => 0xa929597a;
    ///<summary>
    /// User identifier of the service's bot
    ///</summary>
    public long BotId { get; set; }

    ///<summary>
    /// Telegram Passport element types requested by the service
    ///</summary>
    public string Scope { get; set; }

    ///<summary>
    /// Service's public key
    ///</summary>
    public string PublicKey { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        BotId = buffer.ReadInt64();
        Scope = buffer.ReadString();
        PublicKey = buffer.ReadString();
    }
}
