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

namespace MyTelegram.Schema.Stories;

///<summary>
/// Generate a <a href="https://corefork.telegram.org/api/links#story-links">story deep link</a> for a specific story
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// 400 STORY_ID_EMPTY You specified no story IDs.
/// 400 USER_PUBLIC_MISSING Cannot generate a link to stories posted by a peer without a username.
/// See <a href="https://corefork.telegram.org/method/stories.exportStoryLink" />
///</summary>
[TlObject(0x7b8def20)]
public sealed class RequestExportStoryLink : IRequest<MyTelegram.Schema.IExportedStoryLink>
{
    public uint ConstructorId => 0x7b8def20;
    ///<summary>
    /// Peer where the story was posted
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// Story ID
    ///</summary>
    public 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.ReadInt32();
    }
}
