diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/services/responses/service-generic-response.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/services/responses/service-generic-response.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/services/responses/service-generic-response.ts b/catalog-ui/src/app/ng2/services/responses/service-generic-response.ts new file mode 100644 index 0000000000..d32ed26bb2 --- /dev/null +++ b/catalog-ui/src/app/ng2/services/responses/service-generic-response.ts @@ -0,0 +1,22 @@ +import * as _ from "lodash"; +import {Serializable} from "../utils/serializable"; +import {ComponentGenericResponse} from "./component-generic-response"; +import {ForwardingPath} from "../../../models/forwarding-path"; + +export class ServiceGenericResponse extends ComponentGenericResponse implements Serializable<ServiceGenericResponse> { + public forwardingPaths: { [key:string]:ForwardingPath } = {}; + + deserialize (response): ServiceGenericResponse { + super.deserialize(response); + if(response.forwardingPaths) { + _.forEach(response.forwardingPaths, (pathResponse, id) => { + let pathId = id; + let path:ForwardingPath = new ForwardingPath(); + path.deserialize(pathResponse); + path.uniqueId = pathId; + this.forwardingPaths[pathId] = path; + }); + } + return this; + } +}
\ No newline at end of file |