UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

106 lines (100 loc) 2.33 kB
import {ModelDefinition} from './BaseModels'; import {Log} from './Log'; declare var Object: any; export interface SionServerKeyInterface { id?: string; ttl?: number; scopes?: Array<any>; enabled?: boolean; created?: Date; modified?: Date; deleted?: Date; trackingLogs?: Log[]; } export class SionServerKey implements SionServerKeyInterface { id: string; ttl: number = 1209600; scopes: Array<any>; enabled: boolean = true; created: Date; modified: Date; deleted: Date; trackingLogs?: Log[]; constructor(data?: SionServerKeyInterface) { Object.assign(this, data); } /** * The name of the model represented by this $resource, * i.e. `SionServerKey`. */ public static getModelName(): string { return 'SionServerKey'; } /** * @method factory * @author Jonathan Casarrubias * @license MIT * This method creates an instance of SionServerKey for dynamic purposes. */ public static factory(data: SionServerKeyInterface): SionServerKey{ return new SionServerKey(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: 'SionServerKey', plural: 'SionServerKeys', path: 'SionServerKeys', idName: 'id', properties: { id: { name: 'id', type: 'string' }, ttl: { name: 'ttl', type: 'number', default: 1209600 }, scopes: { name: 'scopes', type: 'Array&lt;any&gt;' }, enabled: { name: 'enabled', type: 'boolean', default: true }, created: { name: 'created', type: 'Date' }, modified: { name: 'modified', type: 'Date' }, deleted: { name: 'deleted', type: 'Date', default: undefined }, }, relations: { trackingLogs: { name: 'trackingLogs', type: 'Log[]', model: 'Log', relationType: 'hasMany', keyFrom: 'id', keyTo: 'trackingModelId' }, } }; } }