baasic-sdk-javascript
Version:
JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).
44 lines (43 loc) • 2.29 kB
TypeScript
/**
* @module notificationsPublishClient
* @description Notifications Publish Client provides an easy way to consume Notifications REST API end-points. In order to obtain needed routes `notificationsPublishClient` uses `notificationsPublishRoute`.
*/
import { ApiClient, IHttpResponse } from '../../httpApi';
import { NotificationsPublishBatchClient, NotificationsPublishRoute } from './';
import { INotification } from './contracts';
export declare class NotificationsPublishClient {
protected notificationsPublishRoute: NotificationsPublishRoute;
protected notificationsPublishBatchClient: NotificationsPublishBatchClient;
protected apiClient: ApiClient;
readonly routeDefinition: NotificationsPublishRoute;
readonly batch: NotificationsPublishBatchClient;
constructor(notificationsPublishRoute: NotificationsPublishRoute, notificationsPublishBatchClient: NotificationsPublishBatchClient, apiClient: ApiClient);
/**
* Returns a promise that is resolved once the create notification action has been performed; this action creates a new notification resource.
* @method
* @param data The notification.
* @returns A promise that is resolved once the create notification action has been performed.
* @example notificationsPublishClient.create({
channels: ['<channel-name', '<channel-name>'],
moduleName: '<module-name>',
templateName: '<template-name>',
templateContext: {
prop1: '<prop1-value>',
prop2: '<prop2-value>'
}
})
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
*/
create(data: INotification): PromiseLike<IHttpResponse<INotification>>;
}
/**
* @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.
*/