typings/lib2/messagev2/field/selectFieldOption.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectFieldOption = void 0;
const internal_1 = require("../internal");
/**
 * Represents an option for a select field.
 */
class SelectFieldOption extends internal_1.ChannelCustomizable {
    /**
     * Creates an instance of the SelectFieldOption class.
     * @param {string} label The label of the option.
     * @param {any} value The value of the option. If not specified, the label is used as value.
     */
    constructor(label, value) {
        super();
        this.label = label;
        this.value = value || label;
    }
    /**
     * Gets the label of the option.
     * @returns {string} The label of the option.
     */
    getLabel() {
        return this.label;
    }
    /**
     * Sets the label of the option.
     * @param {string} label The label to set.
     * @returns The updated instance of the SelectFieldOption.
     */
    setLabel(label) {
        this.label = label;
        return this;
    }
    /**
     * Gets the value of the option.
     * @returns {any} The value of the option.
     */
    getValue() {
        return this.value;
    }
    /**
     * Sets the value of the option.
     * @param {any} value The value to set.
     * @returns The updated instance of the SelectFieldOption.
     */
    setValue(value) {
        this.value = value;
        return this;
    }
    /**
     * Gets the image URL of the option.
     * @returns {string} The image URL of the option.
     */
    getImageUrl() {
        return this.imageUrl;
    }
    /**
     * Sets the image URL of the option.
     * @param {string} imageUrl The image URL to set.
     * @returns The updated instance of the SelectFieldOption.
     */
    setImageUrl(imageUrl) {
        this.imageUrl = imageUrl;
        return this;
    }
}
exports.SelectFieldOption = SelectFieldOption;