models/notifications/NotificationButton.js

export default class NotificationButton {
    /**
     * Creates a new Notification instance from the provider parameters.
     *
     * @constructor NotificationButton
     * @param {Object} buttonMap - Notification parameters
     * @param {stirng} buttonMap.actionId - Action ID
     * @param {string} buttonMap.title - Title
     */
    constructor(buttonMap) {
        this.actionId = buttonMap.actionId || null;
        this.title = buttonMap.title || null;
    }

    /**
     * Create a new notification button.
     *
     * @memberof NotificationButton
     * @param {string} title - Button title.
     * @param {string} actionId - Action ID. Could be one {@link #CONSUME_ACTION}, {@link #IGNORE_ACTION} or custom action.
     * @return {NotificationButton} New instance.
     */
    static create(title, actionId) {
        return new NotificationButton({
            title,
            actionId
        });
    }
}