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

namespace MyTelegram.Schema.Messages;

///<summary>
/// See <a href="https://corefork.telegram.org/method/messages.reportMessagesDelivery" />
///</summary>
[TlObject(0x5a6d7395)]
public sealed class RequestReportMessagesDelivery : IRequest<IBool>
{
    public uint ConstructorId => 0x5a6d7395;
    public int Flags { get; set; }
    public bool Push { get; set; }
    public MyTelegram.Schema.IInputPeer Peer { get; set; }
    public TVector<int> Id { get; set; }

    public void ComputeFlag()
    {
        if (Push) { Flags = Flags.SetBit(0); }

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Flags = buffer.ReadInt32();
        if (Flags.IsBitSet(0)) { Push = true; }
        Peer = buffer.Read<MyTelegram.Schema.IInputPeer>();
        Id = buffer.Read<TVector<int>>();
    }
}
