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

namespace MyTelegram.Schema;

///<summary>
/// Defines a document for subsequent interaction.
/// See <a href="https://corefork.telegram.org/constructor/inputDocument" />
///</summary>
[TlObject(0x1abfb575)]
public sealed class TInputDocument : IInputDocument
{
    public uint ConstructorId => 0x1abfb575;
    ///<summary>
    /// Document ID
    ///</summary>
    public long Id { get; set; }

    ///<summary>
    /// <strong>access_hash</strong> parameter from the <a href="https://corefork.telegram.org/constructor/document">document</a> constructor
    ///</summary>
    public long AccessHash { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/file_reference">File reference</a>
    ///</summary>
    public ReadOnlyMemory<byte> FileReference { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Id = buffer.ReadInt64();
        AccessHash = buffer.ReadInt64();
        FileReference = buffer.ReadBytes();
    }
}