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 Automation; (function (Automation) { let Managers; (function (Managers) { class CommentManager extends Platform.Core.BaseManager { getMyCommentsByGuid(refGuid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/communications/getmycommentsbyguid/refGuid/' + refGuid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getCommentsByParentId(Id) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/communications/getcommentsbyparentid/commentid/' + Id; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getCommentByCommentId(commentId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/communications/getcomment/commentid/' + commentId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } saveComment(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/communications/savecomment'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } deleteComment(id) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/communications/deletecomment/commentid/' + id; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } static Instance() { if (this.instance == undefined) { this.instance = new CommentManager(); } return this.instance; } } Managers.CommentManager = CommentManager; })(Managers = Automation.Managers || (Automation.Managers = {})); })(Automation = Platform.Automation || (Platform.Automation = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));