UNPKG

baasic-sdk-javascript

Version:

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

72 lines (71 loc) 3.51 kB
"use strict"; /* globals module */ /** * @module mediaVaultSettingsClient * @description Media Vault Settings Client provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use Baasic Media Vault Settings Route Service to obtain needed routes while other routes will be obtained through HAL. By convention, all route services use the same function names as their corresponding services. */ 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 MediaVaultSettingsClient = /** @class */ (function () { function MediaVaultSettingsClient(mediaVaultSettingsRoute, apiClient) { this.mediaVaultSettingsRoute = mediaVaultSettingsRoute; this.apiClient = apiClient; } Object.defineProperty(MediaVaultSettingsClient.prototype, "routeDefinition", { get: function () { return this.mediaVaultSettingsRoute; }, enumerable: true, configurable: true }); /** * Returns a promise that is resolved once the get action has been performed. Success response returns media vault settings resource. * @method * @returns A promise that is resolved once the get action has been performed. * @example mediaVaultSettingsClient.get() .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ MediaVaultSettingsClient.prototype.get = function () { return this.apiClient.get(this.routeDefinition.get()); }; /** * Returns a promise that is resolved once the update action has been performed; this action updates the media vault settings resource. * @method * @param data A media vault settings object used to update media vault settings in the system. * @returns A promise that is resolved once the update action has been performed. * @example mediaVaultSettingsClient.update(mediaVaultSettings) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ MediaVaultSettingsClient.prototype.update = function (data) { return this.apiClient.put(this.routeDefinition.update(), this.routeDefinition.updateParams(data)); }; MediaVaultSettingsClient = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(_1.TYPES.MediaVaultSettingsRoute)), tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)), tslib_1.__metadata("design:paramtypes", [_1.MediaVaultSettingsRoute, httpApi_1.ApiClient]) ], MediaVaultSettingsClient); return MediaVaultSettingsClient; }()); exports.MediaVaultSettingsClient = MediaVaultSettingsClient; /** * @overview ***Notes:** - Refer to the [REST API documentation](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 service. */