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

namespace MyTelegram.Schema.Stories;

///<summary>
/// Pin some stories to the top of the profile, see <a href="https://corefork.telegram.org/api/stories#pinned-or-archived-stories">here »</a> for more info.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// 400 STORY_ID_INVALID The specified story ID is invalid.
/// See <a href="https://corefork.telegram.org/method/stories.togglePinnedToTop" />
///</summary>
[TlObject(0xb297e9b)]
public sealed class RequestTogglePinnedToTop : IRequest<IBool>
{
    public uint ConstructorId => 0xb297e9b;
    ///<summary>
    /// Peer where to pin stories.
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// IDs of the stories to pin (max <a href="https://corefork.telegram.org/api/config#stories-pinned-to-top-count-max">stories_pinned_to_top_count_max</a>).
    ///</summary>
    public TVector<int> Id { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IInputPeer>();
        Id = buffer.Read<TVector<int>>();
    }
}
