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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Get the exact read date of one of our messages, sent to a private chat with another user.Can be only done for private outgoing messages not older than <a href="https://corefork.telegram.org/api/config#pm-read-date-expire-period">appConfig.pm_read_date_expire_period »</a>.If the <code>peer</code>'s <a href="https://corefork.telegram.org/constructor/userFull">userFull</a>.<code>read_dates_private</code> flag is set, we will not be able to fetch the exact read date of messages we send to them, and a <code>USER_PRIVACY_RESTRICTED</code> RPC error will be emitted.<br>
/// The exact read date of messages might still be unavailable for other reasons, see <a href="https://corefork.telegram.org/constructor/globalPrivacySettings">here »</a> for more info.<br>
/// To set <a href="https://corefork.telegram.org/constructor/userFull">userFull</a>.<code>read_dates_private</code> for ourselves invoke <a href="https://corefork.telegram.org/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>, setting the <code>settings.hide_read_marks</code> flag.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 MESSAGE_ID_INVALID The provided message id is invalid.
/// 400 MESSAGE_NOT_READ_YET The specified message wasn't read yet.
/// 400 MESSAGE_TOO_OLD The message is too old, the requested information is not available.
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// 403 USER_PRIVACY_RESTRICTED The user's privacy settings do not allow you to do this.
/// 403 YOUR_PRIVACY_RESTRICTED You cannot fetch the read date of this message because you have disallowed other users to do so for <em>your</em> messages; to fix, allow other users to see <em>your</em> exact last online date OR purchase a <a href="https://corefork.telegram.org/api/premium">Telegram Premium</a> subscription.
/// See <a href="https://corefork.telegram.org/method/messages.getOutboxReadDate" />
///</summary>
[TlObject(0x8c4bfe5d)]
public sealed class RequestGetOutboxReadDate : IRequest<MyTelegram.Schema.IOutboxReadDate>
{
    public uint ConstructorId => 0x8c4bfe5d;
    ///<summary>
    /// The user to whom we sent the message.
    /// 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; }

    public void ComputeFlag()
    {

    }

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

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