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

namespace MyTelegram.Schema.Messages;

///<summary>
/// View and search recently sent media.<br>
/// This method does not support pagination.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 FILTER_NOT_SUPPORTED The specified filter cannot be used in this context.
/// See <a href="https://corefork.telegram.org/method/messages.searchSentMedia" />
///</summary>
[TlObject(0x107e31a0)]
public sealed class RequestSearchSentMedia : IRequest<MyTelegram.Schema.Messages.IMessages>
{
    public uint ConstructorId => 0x107e31a0;
    ///<summary>
    /// Optional search query
    ///</summary>
    public string Q { get; set; }

    ///<summary>
    /// Message filter
    /// See <a href="https://corefork.telegram.org/type/MessagesFilter" />
    ///</summary>
    public MyTelegram.Schema.IMessagesFilter Filter { get; set; }

    ///<summary>
    /// Maximum number of results to return (max 100).
    ///</summary>
    public int Limit { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Q = buffer.ReadString();
        Filter = buffer.Read<MyTelegram.Schema.IMessagesFilter>();
        Limit = buffer.ReadInt32();
    }
}
