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

namespace MyTelegram.Schema;

///<summary>
/// Assigns a new big encrypted file (over 10 MB in size), saved in parts using the method <a href="https://corefork.telegram.org/method/upload.saveBigFilePart">upload.saveBigFilePart</a>.
/// See <a href="https://corefork.telegram.org/constructor/inputEncryptedFileBigUploaded" />
///</summary>
[TlObject(0x2dc173c8)]
public sealed class TInputEncryptedFileBigUploaded : IInputEncryptedFile
{
    public uint ConstructorId => 0x2dc173c8;
    ///<summary>
    /// Random file id, created by the client
    ///</summary>
    public long Id { get; set; }

    ///<summary>
    /// Number of saved parts
    ///</summary>
    public int Parts { get; set; }

    ///<summary>
    /// 32-bit imprint of the key used to encrypt the file
    ///</summary>
    public int KeyFingerprint { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Id = buffer.ReadInt64();
        Parts = buffer.ReadInt32();
        KeyFingerprint = buffer.ReadInt32();
    }
}