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

namespace MyTelegram.Schema;

///<summary>
/// Connecting or disconnecting a <a href="https://corefork.telegram.org/api/business#connected-bots">business bot</a> or changing the connection settings will emit an <a href="https://corefork.telegram.org/constructor/updateBotBusinessConnect">updateBotBusinessConnect</a> update to the bot, with the new settings and a <code>connection_id</code> that will be used by the bot to handle updates from and send messages as the user.
/// See <a href="https://corefork.telegram.org/constructor/updateBotBusinessConnect" />
///</summary>
[TlObject(0x8ae5c97a)]
public sealed class TUpdateBotBusinessConnect : IUpdate
{
    public uint ConstructorId => 0x8ae5c97a;
    ///<summary>
    /// Business connection settings
    /// See <a href="https://corefork.telegram.org/type/BotBusinessConnection" />
    ///</summary>
    public MyTelegram.Schema.IBotBusinessConnection Connection { get; set; }

    ///<summary>
    /// New <strong>qts</strong> value, see <a href="https://corefork.telegram.org/api/updates">updates »</a> for more info.
    ///</summary>
    public int Qts { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Connection = buffer.Read<MyTelegram.Schema.IBotBusinessConnection>();
        Qts = buffer.ReadInt32();
    }
}