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

namespace MyTelegram.Schema.Account;

///<summary>
/// Report a peer for violation of telegram's Terms of Service
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CHANNEL_PRIVATE You haven't joined this channel/supergroup.
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// See <a href="https://corefork.telegram.org/method/account.reportPeer" />
///</summary>
[TlObject(0xc5ba3d86)]
public sealed class RequestReportPeer : IRequest<IBool>
{
    public uint ConstructorId => 0xc5ba3d86;
    ///<summary>
    /// The peer to report
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// The reason why this peer is being reported
    /// See <a href="https://corefork.telegram.org/type/ReportReason" />
    ///</summary>
    public MyTelegram.Schema.IReportReason Reason { get; set; }

    ///<summary>
    /// Comment for report moderation
    ///</summary>
    public string Message { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IInputPeer>();
        Reason = buffer.Read<MyTelegram.Schema.IReportReason>();
        Message = buffer.ReadString();
    }
}
