UNPKG

baasic-sdk-javascript

Version:

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

80 lines (79 loc) 4.09 kB
/** * @module calendarEventBatchClient * @description CalendarEventBatchClient provides an easy way to consume CalendarEventBatch REST API end-points. In order to obtain needed routes `calendarEventBatchClient` uses `calendarEventBatchRoute`. */ import { ApiClient, IHttpResponse } from '../../../httpApi'; import { CalendarEventBatchRoute } from '../'; import { ICalendarEvent } from '../contracts'; export declare class CalendarEventBatchClient { protected calendarEventBatchRoute: CalendarEventBatchRoute; protected apiClient: ApiClient; readonly routeDefinition: CalendarEventBatchRoute; constructor(calendarEventBatchRoute: CalendarEventBatchRoute, apiClient: ApiClient); /** * Returns a promise that is resolved once the create CalendarEvents action has been performed. This action creates new CalendarEvent resources. * @method * @param data CalendarEvent objects that need to be inserted into the system. * @returns A promise that is resolved once the create CalendarEvents action has been performed. * @example calendarEventBatchClient.create([{ author: <user-info>, authorId: '<author-id>', calendar: <calendar>, calendarId: '<calendar-id>', description: '<description>', detail: <calendar-event-detail>, endTime: '<end-time>', isAllDay: <true|false>, isRecurring: <true|false>, json: '<json>', startTime: '<start-time>', title: '<title'> }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ create(data: ICalendarEvent[]): PromiseLike<IHttpResponse<ICalendarEvent[]>>; /** * Returns a promise that is resolved once the update CalendarEvents action has been performed; this action updates CalendarEvent resources. * @method * @param data CalendarEvent objects used to update specified CalendarEvent resources. * @returns A promise that is resolved once the update CalendarEvents action has been performed. * @example calendarEvents are resources previously fetched using get action. calendarEventBatchClient.update(calendarEvents) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ update(data: ICalendarEvent[]): PromiseLike<IHttpResponse<void>>; /** * Returns a promise that is resolved once the remove action has been performed. This action will remove CalendarEvent resources from the system if successfully completed. * @method * @param data CalendarEvent Ids which uniquely identify CalendarEvent resources to be deleted. * @returns A promise that is resolved once the remove action has been performed. * @example calendarEventIds are identifiers which uniquely identify CalendarEvent resources. calendarEventBatchClient.remove(calendarEventIds) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ remove(data: string[]): PromiseLike<IHttpResponse<void>>; } /** * @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. */