UNPKG

baasic-sdk-javascript

Version:

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

89 lines (88 loc) 4.47 kB
/** * @module dynamicResourceBatchClient * @description DynamicResourceBatchClient provides an easy way to consume DynamicResourceBatchBatch REST API end-points. In order to obtain needed routes `dynamicResourceBatchClient` uses `dynamicResourceBatchRoute`. */ import { ApiClient, IHttpResponse } from '../../httpApi'; import { DynamicResourceBatchRoute } from './'; export declare class DynamicResourceBatchClient { protected dynamicResourceBatchRoute: DynamicResourceBatchRoute; protected apiClient: ApiClient; readonly routeDefinition: DynamicResourceBatchRoute; constructor(dynamicResourceBatchRoute: DynamicResourceBatchRoute, apiClient: ApiClient); /** * Returns a promise that is resolved once the create JSON object action has been performed; this action creates new JSON object resources. * @method * @param data JSON object objects that need to be inserted into the system. * @returns A promise that is resolved once the create JSON object action has been performed. * @example dynamicResourceBatchClient.create([{ name: '<name>' }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ create(data: any[]): PromiseLike<IHttpResponse<any[]>>; /** * Returns a promise that is resolved once the update JSON object action has been performed; this action updates JSON object resources. * @method * @param data JSON object objects used to update specified JSON object resources. * @returns A promise that is resolved once the update JSON object action has been performed. * @example JSON object are resources previously fetched using get action. dynamicResourceBatchClient.update([{ id: '<id>', name: '<name>' }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ update(data: any[]): PromiseLike<IHttpResponse<void>>; /** * Returns a promise that is resolved once the patch JSON object action has been performed; this action patches JSON object resources. * @method * @param data JSON object objects used to patch specified JSON object resources. * @returns A promise that is resolved once the patch JSON object action has been performed. * @example JSON object are resources previously fetched using get action. dynamicResourceBatchClient.patch([{ id: '<id>', name: '<name>' }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); */ patch(data: any[]): PromiseLike<IHttpResponse<void>>; /** * Returns a promise that is resolved once the remove action has been performed. This action will remove JSON object resources from the system if successfully completed. * @method * @param data JSON object Ids which uniquely identify JSON object resources to be deleted. * @returns A promise that is resolved once the remove action has been performed. * @example JSON object Ids are identifiers which uniquely identify JSON object resources. dynamicResourceBatchClient.remove(['<id1>', '<id2>']]) .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. */