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

namespace MyTelegram.Schema;

///<summary>
/// Defines a <a href="https://corefork.telegram.org/api/min">min</a> user that was seen in a certain message of a certain chat.
/// See <a href="https://corefork.telegram.org/constructor/inputUserFromMessage" />
///</summary>
[TlObject(0x1da448e2)]
public sealed class TInputUserFromMessage : IInputUser
{
    public uint ConstructorId => 0x1da448e2;
    ///<summary>
    /// The chat where the user was seen
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// The message ID
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// The identifier of the user that was seen
    ///</summary>
    public long UserId { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IInputPeer>();
        MsgId = buffer.ReadInt32();
        UserId = buffer.ReadInt64();
    }
}