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

namespace MyTelegram.Schema;

///<summary>
/// Describes a <a href="https://corefork.telegram.org/api/business#greeting-messages">Telegram Business greeting</a>, automatically sent to new users writing to us in private for the first time, or after a certain inactivity period.
/// See <a href="https://corefork.telegram.org/constructor/inputBusinessGreetingMessage" />
///</summary>
[TlObject(0x194cb3b)]
public sealed class TInputBusinessGreetingMessage : IInputBusinessGreetingMessage
{
    public uint ConstructorId => 0x194cb3b;
    ///<summary>
    /// ID of a <a href="https://corefork.telegram.org/api/business#quick-reply-shortcuts">quick reply shorcut, containing the greeting messages to send, see here » for more info</a>.
    ///</summary>
    public int ShortcutId { get; set; }

    ///<summary>
    /// Allowed recipients for the greeting messages.
    /// See <a href="https://corefork.telegram.org/type/InputBusinessRecipients" />
    ///</summary>
    public MyTelegram.Schema.IInputBusinessRecipients Recipients { get; set; }

    ///<summary>
    /// The number of days after which a private chat will be considered as inactive; currently, must be one of 7, 14, 21, or 28.
    ///</summary>
    public int NoActivityDays { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        ShortcutId = buffer.ReadInt32();
        Recipients = buffer.Read<MyTelegram.Schema.IInputBusinessRecipients>();
        NoActivityDays = buffer.ReadInt32();
    }
}