UNPKG

baasic-sdk-javascript

Version:

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

98 lines (97 loc) 5.05 kB
"use strict"; /* globals module */ /** * @module calendarEventStatusBatchClient * @description CalendarEventStatusBatchClient provides an easy way to consume CalendarEventStatusBatch REST API end-points. In order to obtain needed routes `calendarEventStatusBatchClient` uses `calendarEventStatusBatchRoute`. */ 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 CalendarEventStatusBatchClient = /** @class */ (function () { function CalendarEventStatusBatchClient(calendarEventStatusBatchRoute, apiClient) { this.calendarEventStatusBatchRoute = calendarEventStatusBatchRoute; this.apiClient = apiClient; } Object.defineProperty(CalendarEventStatusBatchClient.prototype, "routeDefinition", { get: function () { return this.calendarEventStatusBatchRoute; }, enumerable: true, configurable: true }); /** * Returns a promise that is resolved once the create CalendarEventStatuses action has been performed. This action creates new CalendarEventStatus resources. * @method * @param data CalendarEventStatus objects that need to be inserted into the system. * @returns A promise that is resolved once the create CalendarEventStatuses action has been performed. * @example calendarEventStatusBatchClient.create([{ abrv: '<abrv>', json: '<json>', name: '<name>' }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ CalendarEventStatusBatchClient.prototype.create = function (data) { return this.apiClient.post(this.routeDefinition.create(), this.routeDefinition.createParams(data)); }; /** * Returns a promise that is resolved once the update CalendarEventStatuses action has been performed. This action updates CalendarEventStatuse resources. * @method * @param data CalendarEventStatus objects used to update specified CalendarEventStatus resources. * @returns A promise that is resolved once the update CalendarEventStatuses action has been performed. * @example calendarEventStatuses are resources previously fetched using get action. calendarEventStatusBatchClient.update(calendarEventStatuses) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ CalendarEventStatusBatchClient.prototype.update = function (data) { return this.apiClient.put(this.routeDefinition.update(), this.routeDefinition.updateParams(data)); }; /** * Returns a promise that is resolved once the remove action has been performed. This action will remove CalendarEventStatus resources from the system if successfully completed. * @method * @param data CalendarEventStatus Ids which uniquely identify CalendarEventStatus resources to be deleted. * @returns A promise that is resolved once the remove action has been performed. * @example calendarEventStatusIds are identifiers which uniquely identify CalendarEventStatus resources. calendarEventStatusBatchClient.remove(calendarEventStatusIds) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ CalendarEventStatusBatchClient.prototype.remove = function (data) { return this.apiClient.delete(this.routeDefinition.delete(), undefined, this.routeDefinition.deleteParams(data)); }; CalendarEventStatusBatchClient = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(__1.TYPES.CalendarEventStatusBatchRoute)), tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)), tslib_1.__metadata("design:paramtypes", [__1.CalendarEventStatusBatchRoute, httpApi_1.ApiClient]) ], CalendarEventStatusBatchClient); return CalendarEventStatusBatchClient; }()); exports.CalendarEventStatusBatchClient = CalendarEventStatusBatchClient; /** * @copyright (c) 2017 Mono Ltd * @license MIT * @author Mono Ltd * @overview ***Notes:** - Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points. - All end-point objects are transformed by the associated route definition. */