UNPKG

idea-toolbox

Version:
38 lines (37 loc) 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EventNotificationPreference = exports.Notification = void 0; const resource_model_1 = require("./resource.model"); /** * An object to pass to SNS topics that manage notifications. */ class Notification extends resource_model_1.Resource { load(x) { super.load(x); this.project = this.clean(x.project, String); this.subject = this.clean(x.subject, String); this.content = this.clean(x.content, String); if (x.teamId) this.teamId = this.clean(x.teamId, String); if (x.userId) this.userId = this.clean(x.userId, String); if (x.email) this.email = this.clean(x.email, String); if (x.forceEmail) this.forceEmail = true; if (x.event) this.event = this.clean(x.event, String); } } exports.Notification = Notification; /** * Preferences for receiving notifications after a specific event. */ class EventNotificationPreference extends resource_model_1.Resource { load(x) { super.load(x); this.email = this.clean(x.email, Boolean, true); this.push = this.clean(x.push, Boolean, true); } } exports.EventNotificationPreference = EventNotificationPreference;