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