@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
122 lines (116 loc) • 2.5 kB
text/typescript
import {ModelDefinition} from './BaseModels';
import {Log} from './Log';
declare var Object: any;
export interface TimeZoneInterface {
value: string;
abbr: string;
offset: number;
isdst: boolean;
text: string;
utc?: Array<any>;
created?: Date;
modified?: Date;
deleted?: Date;
id?: any;
trackingLogs?: Log[];
}
export class TimeZone implements TimeZoneInterface {
value: string;
abbr: string;
offset: number;
isdst: boolean;
text: string;
utc: Array<any>;
created: Date;
modified: Date;
deleted: Date;
id: any;
trackingLogs?: Log[];
constructor(data?: TimeZoneInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `TimeZone`.
*/
public static getModelName(): string {
return 'TimeZone';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of TimeZone for dynamic purposes.
*/
public static factory(data: TimeZoneInterface): TimeZone{
return new TimeZone(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: 'TimeZone',
plural: 'TimeZones',
path: 'TimeZones',
idName: 'id',
properties: {
value: {
name: 'value',
type: 'string'
},
abbr: {
name: 'abbr',
type: 'string'
},
offset: {
name: 'offset',
type: 'number'
},
isdst: {
name: 'isdst',
type: 'boolean'
},
text: {
name: 'text',
type: 'string'
},
utc: {
name: 'utc',
type: 'Array<any>'
},
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'
},
}
};
}
}