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