UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

103 lines (97 loc) 2.23 kB
import {ModelDefinition} from './BaseModels'; import {Log} from './Log'; import {Project} from './Project'; declare var Object: any; export interface DashboardInterface { created?: Date; modified?: Date; deleted?: Date; id?: any; projectId?: any; trackingLogs?: Log[]; project?: Project; } export class Dashboard implements DashboardInterface { created: Date; modified: Date; deleted: Date; id: any; projectId: any; trackingLogs?: Log[]; project?: Project; constructor(data?: DashboardInterface) { Object.assign(this, data); } /** * The name of the model represented by this $resource, * i.e. `Dashboard`. */ public static getModelName(): string { return 'Dashboard'; } /** * @method factory * @author Jonathan Casarrubias * @license MIT * This method creates an instance of Dashboard for dynamic purposes. */ public static factory(data: DashboardInterface): Dashboard{ return new Dashboard(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: 'Dashboard', plural: 'Dashboards', path: 'Dashboards', idName: 'id', properties: { created: { name: 'created', type: 'Date' }, modified: { name: 'modified', type: 'Date' }, deleted: { name: 'deleted', type: 'Date', default: undefined }, id: { name: 'id', type: 'any' }, projectId: { name: 'projectId', type: 'any' }, }, relations: { trackingLogs: { name: 'trackingLogs', type: 'Log[]', model: 'Log', relationType: 'hasMany', keyFrom: 'id', keyTo: 'trackingModelId' }, project: { name: 'project', type: 'Project', model: 'Project', relationType: 'belongsTo', keyFrom: 'projectId', keyTo: 'id' }, } }; } }