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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Message with a file enclosure sent to a protected chat
/// See <a href="https://corefork.telegram.org/constructor/messages.sentEncryptedFile" />
///</summary>
[TlObject(0x9493ff32)]
public sealed class TSentEncryptedFile : ISentEncryptedMessage
{
    public uint ConstructorId => 0x9493ff32;
    ///<summary>
    /// Sending date
    ///</summary>
    public int Date { get; set; }

    ///<summary>
    /// Attached file
    /// See <a href="https://corefork.telegram.org/type/EncryptedFile" />
    ///</summary>
    public MyTelegram.Schema.IEncryptedFile File { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Date = buffer.ReadInt32();
        File = buffer.Read<MyTelegram.Schema.IEncryptedFile>();
    }
}