typings/lib2/messagev2/action/keyword.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Keyword = void 0;
/**
 * Represents a keyword.
 */
class Keyword {
    /**
     * Creates an instance of Keyword.
     * @param postback - The postback to set.
     * @param keywords - The keywords to set.
     */
    constructor(postback, keywords) {
        this.postback = postback;
        if (keywords) {
            this.keywords = keywords;
        }
    }
    /**
     * Gets the postback associated with the keyword.
     * @returns The postback associated with the keyword.
     */
    getPostback() {
        return this.postback;
    }
    /**
     * Sets the postback associated with the keyword.
     * @param postback - The postback to set.
     * @returns The current instance of the Keyword class.
     */
    setPostback(postback) {
        this.postback = postback;
        return this;
    }
    /**
     * Gets the keywords.
     * @returns The keywords.
     */
    getKeywords() {
        return this.keywords;
    }
    /**
     * Sets the keywords.
     * @param keywords - The keywords to set.
     * @returns The current instance of the Keyword class.
     */
    setKeywords(keywords) {
        this.keywords = keywords;
        return this;
    }
    /**
     * Adds a keyword.
     * @param keyword - The keyword to add.
     * @returns The current instance of the Keyword class.
     */
    addKeyword(keyword) {
        if (!this.keywords) {
            this.keywords = [];
        }
        this.keywords.push(keyword);
        return this;
    }
    /**
     * Gets the skipAutoNumber flag.
     * @returns The skipAutoNumber flag.
     */
    getSkipAutoNumber() {
        return this.skipAutoNumber;
    }
    /**
     * Sets the skipAutoNumber flag.
     * @param skipAutoNumber - The skipAutoNumber flag to set.
     * @returns The current instance of the Keyword class.
     */
    setSkipAutoNumber(skipAutoNumber) {
        this.skipAutoNumber = skipAutoNumber;
        return this;
    }
}
exports.Keyword = Keyword;