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

namespace MyTelegram.Schema;

///<summary>
/// DEPRECATED location of a photo
/// See <a href="https://corefork.telegram.org/constructor/inputFileLocation" />
///</summary>
[TlObject(0xdfdaabe1)]
public sealed class TInputFileLocation : IInputFileLocation
{
    public uint ConstructorId => 0xdfdaabe1;
    ///<summary>
    /// Server volume
    ///</summary>
    public long VolumeId { get; set; }

    ///<summary>
    /// File identifier
    ///</summary>
    public int LocalId { get; set; }

    ///<summary>
    /// Check sum to access the file
    ///</summary>
    public long Secret { 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(VolumeId);
        writer.Write(LocalId);
        writer.Write(Secret);
        writer.Write(FileReference);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        VolumeId = buffer.ReadInt64();
        LocalId = buffer.ReadInt32();
        Secret = buffer.ReadInt64();
        FileReference = buffer.ReadBytes();
    }
}