UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

104 lines (98 loc) 2.2 kB
import {ModelDefinition} from './BaseModels'; import {Log} from './Log'; declare var Object: any; export interface ProjectTagInterface { name: string; description?: string; icon?: string; created?: Date; modified?: Date; deleted?: Date; id?: any; trackingLogs?: Log[]; } export class ProjectTag implements ProjectTagInterface { name: string; description: string; icon: string; created: Date; modified: Date; deleted: Date; id: any; trackingLogs?: Log[]; constructor(data?: ProjectTagInterface) { Object.assign(this, data); } /** * The name of the model represented by this $resource, * i.e. `ProjectTag`. */ public static getModelName(): string { return 'ProjectTag'; } /** * @method factory * @author Jonathan Casarrubias * @license MIT * This method creates an instance of ProjectTag for dynamic purposes. */ public static factory(data: ProjectTagInterface): ProjectTag{ return new ProjectTag(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: 'ProjectTag', plural: 'ProjectTags', path: 'ProjectTags', idName: 'id', properties: { name: { name: 'name', type: 'string' }, description: { name: 'description', type: 'string' }, icon: { name: 'icon', type: 'string' }, 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' }, } }; } }