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

namespace MyTelegram.Schema.Upload;

///<summary>
/// Get SHA256 hashes for verifying downloaded files
/// <para>Possible errors</para>
/// Code Type Description
/// 400 LOCATION_INVALID The provided location is invalid.
/// See <a href="https://corefork.telegram.org/method/upload.getFileHashes" />
///</summary>
[TlObject(0x9156982a)]
public sealed class RequestGetFileHashes : IRequest<TVector<MyTelegram.Schema.IFileHash>>
{
    public uint ConstructorId => 0x9156982a;
    ///<summary>
    /// File
    /// See <a href="https://corefork.telegram.org/type/InputFileLocation" />
    ///</summary>
    public MyTelegram.Schema.IInputFileLocation Location { get; set; }

    ///<summary>
    /// Offset from which to get file hashes
    ///</summary>
    public long Offset { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Location = buffer.Read<MyTelegram.Schema.IInputFileLocation>();
        Offset = buffer.ReadInt64();
    }
}
