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

namespace MyTelegram.Schema;

///<summary>
/// Change of state in an encrypted chat.
/// See <a href="https://corefork.telegram.org/constructor/updateEncryption" />
///</summary>
[TlObject(0xb4a2e88d)]
public sealed class TUpdateEncryption : IUpdate
{
    public uint ConstructorId => 0xb4a2e88d;
    ///<summary>
    /// Encrypted chat
    /// See <a href="https://corefork.telegram.org/type/EncryptedChat" />
    ///</summary>
    public MyTelegram.Schema.IEncryptedChat Chat { get; set; }

    ///<summary>
    /// Date of change
    ///</summary>
    public int Date { get; set; }

    public void ComputeFlag()
    {

    }

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

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