UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

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