UNPKG

@xompass/sdk-cloud-api

Version:

Xompass Client for cloud-api

245 lines (239 loc) 5.39 kB
import {ModelDefinition} from './BaseModels'; declare var Object: any; export interface LogInterface { authorizedRoles?: Array<any>; role?: string; remoteAddress?: string; httpMethod?: string; accessType?: string; method?: string; methodString?: string; query?: any; params?: any; data?: any; embeddedRelationName?: string; accessThrough?: string; created?: Date; modified?: Date; deleted?: Date; id?: any; trackingModelName?: string; trackingModelId?: any; userId?: any; principalType?: string; modelId?: string; modelName?: string; embeddedModelId?: string; embeddedModelName?: string; trackingLogs?: Log[]; user?: any; remoteModel?: any; trackingModel?: any; embeddedModel?: any; } export class Log implements LogInterface { authorizedRoles: Array<any>; role: string; remoteAddress: string; httpMethod: string; accessType: string; method: string; methodString: string; query: any; params: any; data: any; embeddedRelationName: string; accessThrough: string; created: Date; modified: Date; deleted: Date; id: any; trackingModelName: string; trackingModelId: any; userId: any; principalType: string; modelId: string; modelName: string; embeddedModelId: string; embeddedModelName: string; trackingLogs?: Log[]; user?: any; remoteModel?: any; trackingModel?: any; embeddedModel?: any; constructor(data?: LogInterface) { Object.assign(this, data); } /** * The name of the model represented by this $resource, * i.e. `Log`. */ public static getModelName(): string { return 'Log'; } /** * @method factory * @author Jonathan Casarrubias * @license MIT * This method creates an instance of Log for dynamic purposes. */ public static factory(data: LogInterface): Log{ return new Log(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: 'Log', plural: 'Logs', path: 'Logs', idName: 'id', properties: { authorizedRoles: { name: 'authorizedRoles', type: 'Array&lt;any&gt;' }, role: { name: 'role', type: 'string' }, remoteAddress: { name: 'remoteAddress', type: 'string' }, httpMethod: { name: 'httpMethod', type: 'string' }, accessType: { name: 'accessType', type: 'string' }, method: { name: 'method', type: 'string' }, methodString: { name: 'methodString', type: 'string' }, query: { name: 'query', type: 'any' }, params: { name: 'params', type: 'any' }, data: { name: 'data', type: 'any' }, embeddedRelationName: { name: 'embeddedRelationName', type: 'string' }, accessThrough: { name: 'accessThrough', type: 'string' }, created: { name: 'created', type: 'Date' }, modified: { name: 'modified', type: 'Date' }, deleted: { name: 'deleted', type: 'Date', default: undefined }, id: { name: 'id', type: 'any' }, trackingModelName: { name: 'trackingModelName', type: 'string' }, trackingModelId: { name: 'trackingModelId', type: 'any' }, userId: { name: 'userId', type: 'any' }, principalType: { name: 'principalType', type: 'string' }, modelId: { name: 'modelId', type: 'string' }, modelName: { name: 'modelName', type: 'string' }, embeddedModelId: { name: 'embeddedModelId', type: 'string' }, embeddedModelName: { name: 'embeddedModelName', type: 'string' }, }, relations: { trackingLogs: { name: 'trackingLogs', type: 'Log[]', model: 'Log', relationType: 'hasMany', keyFrom: 'id', keyTo: 'trackingModelId' }, user: { name: 'user', type: 'any', model: '', relationType: 'belongsTo', keyFrom: 'userId', keyTo: 'id' }, remoteModel: { name: 'remoteModel', type: 'any', model: '', relationType: 'belongsTo', keyFrom: 'modelId', keyTo: 'id' }, trackingModel: { name: 'trackingModel', type: 'any', model: '', relationType: 'belongsTo', keyFrom: 'trackingModelId', keyTo: 'id' }, embeddedModel: { name: 'embeddedModel', type: 'any', model: '', relationType: 'belongsTo', keyFrom: 'embeddedModelId', keyTo: 'id' }, } }; } }