@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
84 lines (78 loc) • 1.85 kB
text/typescript
import {ModelDefinition} from './BaseModels';
declare var Object: any;
export interface NotificationInterface {
enabled?: boolean;
sendEmail?: boolean;
sendSMS?: boolean;
minInterval?: number;
id?: any;
}
export class Notification implements NotificationInterface {
enabled: boolean = true;
sendEmail: boolean = true;
sendSMS: boolean = true;
minInterval: number = 30;
id: any;
constructor(data?: NotificationInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `Notification`.
*/
public static getModelName(): string {
return 'Notification';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of Notification for dynamic purposes.
*/
public static factory(data: NotificationInterface): Notification{
return new Notification(data);
}
/**
* @method getModelDefinition
* @author Julien Ledun
* @license MIT
* This method returns an object that represents some of the model
* definitions.
*/
public static getModelDefinition(): ModelDefinition {
return {
name: 'Notification',
plural: 'Notifications',
path: 'Notifications',
idName: 'id',
properties: {
enabled: {
name: 'enabled',
type: 'boolean',
default: true
},
sendEmail: {
name: 'sendEmail',
type: 'boolean',
default: true
},
sendSMS: {
name: 'sendSMS',
type: 'boolean',
default: true
},
minInterval: {
name: 'minInterval',
type: 'number',
default: 30
},
id: {
name: 'id',
type: 'any'
},
},
relations: {
}
};
}
}