baasic-sdk-javascript
Version:
JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).
102 lines (101 loc) • 5.2 kB
JavaScript
;
/* globals module */
/**
* @module calendarEventRsvpBatchClient
* @description CalendarEventRsvpBatchClient provides an easy way to consume CalendarEventRsvpBatch REST API end-points. In order to obtain needed routes `calendarEventRsvpBatchClient` uses `calendarEventRsvpBatchRoute`.
*/
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 CalendarEventRsvpBatchClient = /** @class */ (function () {
function CalendarEventRsvpBatchClient(calendarEventRsvpBatchRoute, apiClient) {
this.calendarEventRsvpBatchRoute = calendarEventRsvpBatchRoute;
this.apiClient = apiClient;
}
Object.defineProperty(CalendarEventRsvpBatchClient.prototype, "routeDefinition", {
get: function () {
return this.calendarEventRsvpBatchRoute;
},
enumerable: true,
configurable: true
});
/**
* Returns a promise that is resolved once the create CalendarEventRsvps action has been performed; this action creates new CalendarEventRsvp resources.
* @method
* @param data CalendarEventRsvp objects that need to be inserted into the system.
* @returns A promise that is resolved once the create CalendarEventRsvps action has been performed.
* @example calendarEventRsvpBatchClient.create([{
InvitationOnly: <true|false>,
InvitationType: <invitation-type>,
InvitationTypeId: '<id>',
Json: '<json>',
MaxSlots: 50,
MinSlots: 10,
RegistrationCloseDate?: '<close-date>',
TotalSlots: 65,
}])
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
*/
CalendarEventRsvpBatchClient.prototype.create = function (data) {
return this.apiClient.post(this.routeDefinition.create(), this.routeDefinition.createParams(data));
};
/**
* Returns a promise that is resolved once the update CalendarEventRsvps action has been performed; this action updates CalendarEventRsvp resources.
* @method
* @param data CalendarEventRsvp objects used to update specified CalendarEventRsvp resources.
* @returns A promise that is resolved once the update CalendarEventRsvps action has been performed.
* @example calendarEventRsvps are resources previously fetched using get action.
calendarEventRsvpBatchClient.update(calendarEventRsvps)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
*/
CalendarEventRsvpBatchClient.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 CalendarEventRsvp resources from the system if successfully completed.
* @method
* @param data CalendarEventRsvp Ids which uniquely identify CalendarEventRsvp resources to be deleted.
* @returns A promise that is resolved once the remove action has been performed.
* @example calendarEventRsvpIds are identifiers which uniquely identify CalendarEventRsvp resources.
calendarEventRsvpBatchClient.remove(calendarEventRsvpIds)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
*/
CalendarEventRsvpBatchClient.prototype.remove = function (data) {
return this.apiClient.delete(this.routeDefinition.delete(), undefined, this.routeDefinition.deleteParams(data));
};
CalendarEventRsvpBatchClient = tslib_1.__decorate([
inversify_1.injectable(),
tslib_1.__param(0, inversify_1.inject(__1.TYPES.CalendarEventRsvpBatchRoute)),
tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)),
tslib_1.__metadata("design:paramtypes", [__1.CalendarEventRsvpBatchRoute,
httpApi_1.ApiClient])
], CalendarEventRsvpBatchClient);
return CalendarEventRsvpBatchClient;
}());
exports.CalendarEventRsvpBatchClient = CalendarEventRsvpBatchClient;
/**
* @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.
*/