export class ConfigurationDetails { public static fromJson (obj: any) { // TODO check if fields exist to get the error return new ConfigurationDetails( obj.name, obj.logo, obj.color, obj.images, obj.modules, obj.printers, obj.type ); } public toJson() { let obj: any = {}; obj.name = this.getName(); obj.logo = this.getLogo(); obj.images = this.getImages(); obj.modules = this.getModules(); obj.printers = this.getPrinters(); obj.type = this.getType(); return obj; } constructor( public name: string , public logo: string , public color: string , public images: {} , public modules: {} , public printers: Object[] , public type: string // version // created ) {} getName() { return this.name; } getLogo() { return this.logo; } getColor() { return this.color; } getImages() { return this.images; } getModules() { return this.modules; } getPrinters() { return this.printers; } getType() { return this.type;} }