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.74 kB
TypeScript
/**
* @module meteringCategoryBatchClient
* @description Metering Category Batch Client provides an easy way to consume Metering REST API end-points. In order to obtain a needed routes `meteringCategoryBatchClient` uses `meteringCategoryBatchRoute`.
*/
import { ApiClient, IHttpResponse } from '../../httpApi';
import { MeteringCategoryBatchRoute } from './';
import { IMeteringCategory } from './contracts';
export declare class MeteringCategoryBatchClient {
protected meteringCategoryBatchRoute: MeteringCategoryBatchRoute;
protected apiClient: ApiClient;
readonly routeDefinition: MeteringCategoryBatchRoute;
constructor(meteringCategoryBatchRoute: MeteringCategoryBatchRoute, apiClient: ApiClient);
/**
* Returns a promise that is resolved once the create category action has been performed; this action creates new category resources.
* @method
* @param data An MeteringCategory objects that need to be inserted into the system.
* @returns A promise that is resolved once the create category action has been performed.
* @example meteringCategoryBatchClient.create([{
aggregateFunction : '<aggregateFunction>',
category : '<name>',
defaultSamplingRate: '<defaultSamplingRate>',
slug: '<slug>',
unitFactor: '<unitFactor>',
unitName: '<unitName>'
}])
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
**/
create(data: IMeteringCategory[]): PromiseLike<IHttpResponse<IMeteringCategory[]>>;
/**
* Returns a promise that is resolved once the update category action has been performed; this action updates specified category resources.
* @method
* @param data An MeteringCategory objects used to update specified MeteringCategory resources.
* @returns A promise that is resolved once the update category action has been performed.
* @example meteringCategoryClient.update(companies)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
**/
update(data: IMeteringCategory[]): PromiseLike<IHttpResponse<void>>;
/**
* Returns a promise that is resolved once the remove action has been performed. This action will remove category resources from the system if successfully completed.
* @method
* @param ids MeteringCategory ids which uniquely identify MeteringCategory resources that need to be deleted.
* @returns A promise that is resolved once the remove action has been performed.
* @example companyClient.remove(companyIds)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
**/
delete(ids: 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 service.
*/