@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
137 lines (131 loc) • 3.29 kB
text/typescript
import {ModelDefinition} from './BaseModels';
import {Log} from './Log';
import {Project} from './Project';
import {VirtualExpression} from './VirtualExpression';
import {VirtualVariable} from './VirtualVariable';
declare var Object: any;
export interface VirtualGroupInterface {
name?: string;
description?: string;
created?: Date;
modified?: Date;
deleted?: Date;
id?: any;
projectId?: any;
trackingLogs?: Log[];
project?: Project;
virtualExpressions?: VirtualExpression[];
virtualVariables?: VirtualVariable[];
}
export class VirtualGroup implements VirtualGroupInterface {
name: string;
description: string;
created: Date;
modified: Date;
deleted: Date;
id: any;
projectId: any;
trackingLogs?: Log[];
project?: Project;
virtualExpressions?: VirtualExpression[];
virtualVariables?: VirtualVariable[];
constructor(data?: VirtualGroupInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `VirtualGroup`.
*/
public static getModelName(): string {
return 'VirtualGroup';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of VirtualGroup for dynamic purposes.
*/
public static factory(data: VirtualGroupInterface): VirtualGroup{
return new VirtualGroup(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: 'VirtualGroup',
plural: 'VirtualGroups',
path: 'VirtualGroups',
idName: 'id',
properties: {
name: {
name: 'name',
type: 'string'
},
description: {
name: 'description',
type: 'string'
},
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'
},
virtualExpressions: {
name: 'virtualExpressions',
type: 'VirtualExpression[]',
model: 'VirtualExpression',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'virtualGroupId'
},
virtualVariables: {
name: 'virtualVariables',
type: 'VirtualVariable[]',
model: 'VirtualVariable',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'virtualGroupId'
},
}
};
}
}