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

namespace MyTelegram.Schema;

///<summary>
/// DEPRECATED legacy photo file location
/// See <a href="https://corefork.telegram.org/constructor/inputPhotoLegacyFileLocation" />
///</summary>
[TlObject(0xd83466f3)]
public sealed class TInputPhotoLegacyFileLocation : IInputFileLocation
{
    public uint ConstructorId => 0xd83466f3;
    ///<summary>
    /// Photo ID
    ///</summary>
    public long Id { get; set; }

    ///<summary>
    /// Access hash
    ///</summary>
    public long AccessHash { get; set; }

    ///<summary>
    /// File reference
    ///</summary>
    public ReadOnlyMemory<byte> FileReference { get; set; }

    ///<summary>
    /// Volume ID
    ///</summary>
    public long VolumeId { get; set; }

    ///<summary>
    /// Local ID
    ///</summary>
    public int LocalId { get; set; }

    ///<summary>
    /// Secret
    ///</summary>
    public long Secret { get; set; }

    public void ComputeFlag()
    {

    }

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

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