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

namespace MyTelegram.Schema.Messages;

///<summary>
/// See <a href="https://corefork.telegram.org/constructor/messages.preparedInlineMessage" />
///</summary>
[TlObject(0xff57708d)]
public sealed class TPreparedInlineMessage : IPreparedInlineMessage
{
    public uint ConstructorId => 0xff57708d;
    ///<summary>
    /// &nbsp;
    ///</summary>
    public long QueryId { get; set; }

    ///<summary>
    /// &nbsp;
    /// See <a href="https://corefork.telegram.org/type/BotInlineResult" />
    ///</summary>
    public MyTelegram.Schema.IBotInlineResult Result { get; set; }

    ///<summary>
    /// &nbsp;
    ///</summary>
    public TVector<MyTelegram.Schema.IInlineQueryPeerType> PeerTypes { get; set; }

    ///<summary>
    /// &nbsp;
    ///</summary>
    public int CacheTime { get; set; }

    ///<summary>
    /// &nbsp;
    ///</summary>
    public TVector<MyTelegram.Schema.IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(QueryId);
        writer.Write(Result);
        writer.Write(PeerTypes);
        writer.Write(CacheTime);
        writer.Write(Users);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        QueryId = buffer.ReadInt64();
        Result = buffer.Read<MyTelegram.Schema.IBotInlineResult>();
        PeerTypes = buffer.Read<TVector<MyTelegram.Schema.IInlineQueryPeerType>>();
        CacheTime = buffer.ReadInt32();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
    }
}