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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Changes the default value of the Time-To-Live setting, applied to all new chats.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 TTL_PERIOD_INVALID The specified TTL period is invalid.
/// See <a href="https://corefork.telegram.org/method/messages.setDefaultHistoryTTL" />
///</summary>
[TlObject(0x9eb51445)]
public sealed class RequestSetDefaultHistoryTTL : IRequest<IBool>
{
    public uint ConstructorId => 0x9eb51445;
    ///<summary>
    /// The new default Time-To-Live of all messages sent in new chats.
    ///</summary>
    public int Period { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Period = buffer.ReadInt32();
    }
}
