var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Communications; (function (Communications) { let Managers; (function (Managers) { class ReminderManager extends Platform.Core.BaseManager { static Instance() { if (this._instance === undefined) this._instance = new ReminderManager(); return this._instance; } getReminders(ReminderType, pagesize) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/' + ReminderType + '/PageSize/' + pagesize; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } changeReminderStatus(reminderid, status) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/reminders/platform/changereminderstatus/reminderid/' + reminderid + '/status/' + status; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getUnreadRemindersCount(ReminderType) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/reminders/platform/unreadreminderscount/remindertype/' + ReminderType; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } getUnreadRemindersCountByUserId() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/reminders/platform/getunreadreminderscount'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } saveInstantReminder(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/saveinstantreminder'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } sendInstantReminder(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/sendinstantreminder'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getInstantReminder(instantreminderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/Getinstantreminder/instantreminderid/' + instantreminderid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getRemindersWithType(ExecutedActionId, IsTask) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/reminders/platform/getreminders/executedactionid/' + ExecutedActionId + '/istask/' + IsTask; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } updateIsDuplicate(instantreminderid, Isduplicate) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/UpdateIsduplicate/instantreminderid/' + instantreminderid + '/Isduplicate/' + Isduplicate; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getRecipients(instantreminderid, isduplicate) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/Getrecipients/instantreminderid/' + instantreminderid + '/isduplicate/' + isduplicate; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } markAsReadUnreadReminders(reminders) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/reminders/platform/MarkallUnreadreminders'; return yield this.dataHelper().postAsync(url, reminders).then(function (response) { return response; }); }); } ChangeAllReminderStatusAsRead() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/reminders/platform/ChangeReminderStatusAsRead/np'; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } ExportSingleInstantReminder(Instantreminderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/ExportInstantReminder/InstantReminderId/' + Instantreminderid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response = response.result; } return response; }); }); } ExportInstantReminders() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/ExportAllnstantReminders'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response = response.result; } return response; }); }); } SendToAll(refguid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/instantreminders/platform/SendInstantReminderToAllTenants/RefGuid/' + refguid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result != null) { response = response.result; } return response; }); }); } } Managers.ReminderManager = ReminderManager; })(Managers = Communications.Managers || (Communications.Managers = {})); })(Communications = Platform.Communications || (Platform.Communications = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));