@xompass/sdk-cloud-api
Version:
Xompass Client for cloud-api
120 lines (114 loc) • 2.78 kB
text/typescript
import {ModelDefinition} from './BaseModels';
import {Log} from './Log';
import {YoloClass} from './YoloClass';
import {Customer} from './Customer';
declare var Object: any;
export interface YoloClassCustomerInterface {
created?: Date;
modified?: Date;
deleted?: Date;
id?: any;
yoloClassId?: any;
customerId?: any;
trackingLogs?: Log[];
yoloClass?: YoloClass;
customer?: Customer;
}
export class YoloClassCustomer implements YoloClassCustomerInterface {
created: Date;
modified: Date;
deleted: Date;
id: any;
yoloClassId: any;
customerId: any;
trackingLogs?: Log[];
yoloClass?: YoloClass;
customer?: Customer;
constructor(data?: YoloClassCustomerInterface) {
Object.assign(this, data);
}
/**
* The name of the model represented by this $resource,
* i.e. `YoloClassCustomer`.
*/
public static getModelName(): string {
return 'YoloClassCustomer';
}
/**
* @method factory
* @author Jonathan Casarrubias
* @license MIT
* This method creates an instance of YoloClassCustomer for dynamic purposes.
*/
public static factory(data: YoloClassCustomerInterface): YoloClassCustomer{
return new YoloClassCustomer(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: 'YoloClassCustomer',
plural: 'YoloClassCustomers',
path: 'YoloClassCustomers',
idName: 'id',
properties: {
created: {
name: 'created',
type: 'Date'
},
modified: {
name: 'modified',
type: 'Date'
},
deleted: {
name: 'deleted',
type: 'Date',
default: undefined
},
id: {
name: 'id',
type: 'any'
},
yoloClassId: {
name: 'yoloClassId',
type: 'any'
},
customerId: {
name: 'customerId',
type: 'any'
},
},
relations: {
trackingLogs: {
name: 'trackingLogs',
type: 'Log[]',
model: 'Log',
relationType: 'hasMany',
keyFrom: 'id',
keyTo: 'trackingModelId'
},
yoloClass: {
name: 'yoloClass',
type: 'YoloClass',
model: 'YoloClass',
relationType: 'belongsTo',
keyFrom: 'yoloClassId',
keyTo: 'id'
},
customer: {
name: 'customer',
type: 'Customer',
model: 'Customer',
relationType: 'belongsTo',
keyFrom: 'customerId',
keyTo: 'id'
},
}
};
}
}