UNPKG

baasic-sdk-javascript

Version:

JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).

82 lines (81 loc) 4.44 kB
"use strict"; /* globals module */ /** * @module articleSubscriptionsCommentReportedClient * @description Article Subscriptions Comment Reported Client provides an easy way to consume Articles REST API end-points. In order to obtain needed routes `articleSubscriptionsCommentReportedClient` uses `articleSubscriptionsCommentReportedRoute`. */ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var inversify_1 = require("inversify"); var httpApi_1 = require("../../../httpApi"); var __1 = require("../"); var ArticleSubscriptionsCommentReportedClient = /** @class */ (function () { function ArticleSubscriptionsCommentReportedClient(articleSubscriptionsCommentReportedRoute, apiClient) { this.articleSubscriptionsCommentReportedRoute = articleSubscriptionsCommentReportedRoute; this.apiClient = apiClient; } Object.defineProperty(ArticleSubscriptionsCommentReportedClient.prototype, "routeDefinition", { get: function () { return this.articleSubscriptionsCommentReportedRoute; }, enumerable: true, configurable: true }); /** * Subscribes user to article comment reported updates. Returns a promise that is resolved once the subscribe action has been performed. * @method * @param data The subscribe information. * @returns A promise that is resolved once the subscribe action has been performed. * @example articleSubscriptionsCommentReportedClient.subscribe(data) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ ArticleSubscriptionsCommentReportedClient.prototype.subscribe = function (data) { return this.apiClient.post(this.articleSubscriptionsCommentReportedRoute.subscribe(data), data); }; /** * Determines whether user is subscribed to article comment reported updates. Returns a promise that is resolved once the isSubscribed action has been performed. * @method * @param data The subscribe information. * @returns A promise that is resolved once the isSubscribed action has been performed. * @example articleSubscriptionsCommentReportedClient.isSubscribed(data) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ ArticleSubscriptionsCommentReportedClient.prototype.isSubscribed = function (data) { return this.apiClient.get(this.routeDefinition.isSubscribed(data)); }; /** * Unsubscribe user from article comment reported updates. Returns a promise that is commentReported once the unSubscribe action has been performed. * @method * @param data The unsubscribe information. * @returns A promise that is commentReported once the unSubscribe action has been performed. * @example articleSubscriptionsCommentReportedClient.isSubscribed(data) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ ArticleSubscriptionsCommentReportedClient.prototype.unSubscribe = function (data) { return this.apiClient.delete(this.articleSubscriptionsCommentReportedRoute.unSubscribe(data), undefined, data); }; ArticleSubscriptionsCommentReportedClient = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(__1.TYPES.ArticleSubscriptionsCommentReportedRoute)), tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)), tslib_1.__metadata("design:paramtypes", [__1.ArticleSubscriptionsCommentReportedRoute, httpApi_1.ApiClient]) ], ArticleSubscriptionsCommentReportedClient); return ArticleSubscriptionsCommentReportedClient; }()); exports.ArticleSubscriptionsCommentReportedClient = ArticleSubscriptionsCommentReportedClient;