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

namespace MyTelegram.Schema;

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

    ///<summary>
    /// The message ID in the chat where the channel was seen
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// The channel ID
    ///</summary>
    public long ChannelId { get; set; }

    public void ComputeFlag()
    {

    }

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

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