@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
114 lines (108 loc) • 2.52 kB
text/typescript
import {ModelDefinition} from './BaseModels';
import {Log} from './Log';
declare var Object: any;
export interface NotificationQueueInterface {
data: any;
created?: Date;
modified?: Date;
deleted?: Date;
id?: any;
modelId?: string;
modelName?: string;
trackingLogs?: Log[];
instance?: any;
}
export class NotificationQueue implements NotificationQueueInterface {
data: any;
created: Date;
modified: Date;
deleted: Date;
id: any;
modelId: string;
modelName: string;
trackingLogs?: Log[];
instance?: any;
constructor(data?: NotificationQueueInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `NotificationQueue`.
*/
public static getModelName(): string {
return 'NotificationQueue';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of NotificationQueue for dynamic purposes.
*/
public static factory(data: NotificationQueueInterface): NotificationQueue{
return new NotificationQueue(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: 'NotificationQueue',
plural: 'NotificationQueues',
path: 'NotificationQueues',
idName: 'id',
properties: {
data: {
name: 'data',
type: 'any'
},
created: {
name: 'created',
type: 'Date'
},
modified: {
name: 'modified',
type: 'Date'
},
deleted: {
name: 'deleted',
type: 'Date',
default: undefined
},
id: {
name: 'id',
type: 'any'
},
modelId: {
name: 'modelId',
type: 'string'
},
modelName: {
name: 'modelName',
type: 'string'
},
},
relations: {
trackingLogs: {
name: 'trackingLogs',
type: 'Log[]',
model: 'Log',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'trackingModelId'
},
instance: {
name: 'instance',
type: 'any',
model: '',
relationType: 'belongsTo',
keyFrom: 'modelId',
keyTo: 'id'
},
}
};
}
}