baasic-sdk-javascript
Version:
JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).
93 lines (92 loc) • 5.26 kB
JavaScript
;
/* globals module */
/**
* @module notificationsRegistrationsAnonymousBatchClient
* @description Notifications Registrations Anonymous Batch Client provides an easy way to consume Notifications REST API end-points. In order to obtain needed routes `notificationsRegistrationsAnonymousBatchClient` uses `notificationsRegistrationsAnonymousBatchRoute`.
*/
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 NotificationsRegistrationsAnonymousBatchClient = /** @class */ (function () {
function NotificationsRegistrationsAnonymousBatchClient(notificationsRegistrationsAnonymousBatchRoute, apiClient) {
this.notificationsRegistrationsAnonymousBatchRoute = notificationsRegistrationsAnonymousBatchRoute;
this.apiClient = apiClient;
}
Object.defineProperty(NotificationsRegistrationsAnonymousBatchClient.prototype, "routeDefinition", {
get: function () {
return this.notificationsRegistrationsAnonymousBatchRoute;
},
enumerable: true,
configurable: true
});
/**
* Returns a promise that is resolved once the create anonymous registration action has been performed; this action creates new anonymous registration resources.
* @method
* @param data AnonymousRegistration objects that need to be inserted into the system.
* @returns A promise that is resolved once the create anonymous registration action has been performed.
* @example notificationsRegistrationsAnonymousBatchClient.create([{
provider: '<provider-name>',
providerData: <provider-data>,
expirationDate: <expiration-date>
}])
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
*/
NotificationsRegistrationsAnonymousBatchClient.prototype.create = function (data) {
return this.apiClient.post(this.routeDefinition.create(), this.routeDefinition.createParams(data));
};
/**
* Returns a promise that is resolved once the remove action has been performed. This action will remove anonymous registration resources from the system if successfully completed.
* @method
* @param ids The registration ids which uniquely identify AnonymousRegistration resources that need to be deleted.
* @returns A promise that is resolved once the remove action has been performed.
* @example notificationsRegistrationsAnonymousBatchClient.remove(subscriptionIds)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
*/
NotificationsRegistrationsAnonymousBatchClient.prototype.remove = function (ids) {
return this.apiClient.delete(this.notificationsRegistrationsAnonymousBatchRoute.delete(), undefined, ids);
};
/**
* Returns a promise that is resolved once the update anonymous registration action has been performed; this action updates specified anonymous registration resources.
* @method
* @param data AnonymousRegistration objects used to update specified AnonymousRegistration resources.
* @returns A promise that is resolved once the update anonymous registration action has been performed.
* @example notificationsRegistrationsAnonymousBatchClient.update(registrations)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
*/
NotificationsRegistrationsAnonymousBatchClient.prototype.update = function (data) {
return this.apiClient.put(this.routeDefinition.update(), this.routeDefinition.updateParams(data));
};
NotificationsRegistrationsAnonymousBatchClient = tslib_1.__decorate([
inversify_1.injectable(),
tslib_1.__param(0, inversify_1.inject(_1.TYPES.NotificationsRegistrationsAnonymousBatchRoute)),
tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)),
tslib_1.__metadata("design:paramtypes", [_1.NotificationsRegistrationsAnonymousBatchRoute,
httpApi_1.ApiClient])
], NotificationsRegistrationsAnonymousBatchClient);
return NotificationsRegistrationsAnonymousBatchClient;
}());
exports.NotificationsRegistrationsAnonymousBatchClient = NotificationsRegistrationsAnonymousBatchClient;
/**
* @overview
***Notes:**
- Refer to the [REST API documentation](https://github.com/Baasic/baasic-rest-api/wiki) for detailed information about available Baasic REST API end-points.
- All end-point objects are transformed by the associated route service.
*/