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

namespace MyTelegram.Schema;

///<summary>
/// Admin log event
/// See <a href="https://corefork.telegram.org/constructor/channelAdminLogEvent" />
///</summary>
[TlObject(0x1fad68cd)]
public sealed class TChannelAdminLogEvent : IChannelAdminLogEvent
{
    public uint ConstructorId => 0x1fad68cd;
    ///<summary>
    /// Event ID
    ///</summary>
    public long Id { get; set; }

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

    ///<summary>
    /// User ID
    ///</summary>
    public long UserId { get; set; }

    ///<summary>
    /// Action
    /// See <a href="https://corefork.telegram.org/type/ChannelAdminLogEventAction" />
    ///</summary>
    public MyTelegram.Schema.IChannelAdminLogEventAction Action { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Id = buffer.ReadInt64();
        Date = buffer.ReadInt32();
        UserId = buffer.ReadInt64();
        Action = buffer.Read<MyTelegram.Schema.IChannelAdminLogEventAction>();
    }
}