typings/lib2/messagev2/common/formRow.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormRow = void 0;
const internal_1 = require("../internal");
/**
 * Represents a form row
 * @extends ChannelCustomizable
 */
class FormRow extends internal_1.ChannelCustomizable {
    /**
     * Creates an instance of the FormRow class.
     * @param {Column[]} [columns] The list of columns in the form row
     */
    constructor(columns) {
        super();
        this.columns = [];
        if (columns) {
            this.columns = columns;
        }
    }
    /**
     * Deserialize nested object properties into corresponding class instances
     */
    deserializeNestedProperties() {
        super.deserializeNestedProperties();
        this.columns = internal_1.MessageUtil.deserializeColumns(this.columns);
        if (this.selectAction) {
            this.selectAction = internal_1.MessageUtil.deserializeAction(this.selectAction);
        }
    }
    /**
     * Gets the ID of the form row.
     * @returns {string} The ID of the form row.
     */
    getId() {
        return this.id;
    }
    /**
     * Sets the ID of the form row.
     * @param {string} id The ID to set.
     * @returns {FormRow} The updated instance of the FormRow.
     */
    setId(id) {
        this.id = id;
        return this;
    }
    /**
     * Gets the separator of the form row.
     * @returns {boolean} The separator
     */
    getSeparator() {
        return this.separator;
    }
    /**
     * Sets the separator of the form row.
     * @param {boolean} flag to add separator
     * @returns {FormRow} The updated instance of the FormRow.
     */
    setSeparator(separator) {
        this.separator = separator;
        return this;
    }
    /**
     * Gets the list of columns in the form row.
     * @returns {Column[]} The list of columns in the form row.
     */
    getColumns() {
        return this.columns;
    }
    /**
     * Sets the columns of the form row.
     * @param {Column[]} columns The columns to set.
     * @returns {FormRow} The updated instance of the FormRow.
     */
    setColumns(columns) {
        this.columns = columns;
        return this;
    }
    /**
     * Adds a column to the form row.
     * @param {Column} column The column to add.
     * @returns {FormRow} The updated instance of the FormRow.
     */
    addColumn(column) {
        this.columns.push(column);
        return this;
    }
    /**
     * Gets the select action of the form row.
     * @returns The select action of the form row.
     */
    getSelectAction() {
        return this.selectAction;
    }
    /**
     * Sets the select action of the form row.
     * @param selectAction The select action to set.
     * @returns The updated instance of the FormRow.
     */
    setSelectAction(selectAction) {
        this.selectAction = selectAction;
        return this;
    }
}
exports.FormRow = FormRow;