summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/services/responses
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2/services/responses')
-rw-r--r--catalog-ui/src/app/ng2/services/responses/component-generic-response.ts5
-rw-r--r--catalog-ui/src/app/ng2/services/responses/service-generic-response.ts22
2 files changed, 27 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts
index 9450e4bc04..e7c88a0ab8 100644
--- a/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts
+++ b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts
@@ -27,6 +27,7 @@ import { ArtifactGroupModel, PropertyModel, PropertiesGroup, AttributeModel, Att
import {CommonUtils} from "app/utils";
import {Serializable} from "../utils/serializable";
import {PropertyBEModel} from "../../../models/properties-inputs/property-be-model";
+import { PolicyInstance } from "app/models/graph/zones/policy-instance";
export class ComponentGenericResponse implements Serializable<ComponentGenericResponse> {
@@ -43,6 +44,7 @@ export class ComponentGenericResponse implements Serializable<ComponentGenericR
public requirements:RequirementsGroup;
public properties:Array<PropertyModel>;
public attributes:Array<AttributeModel>;
+ public policies:Array<PolicyInstance>;
public groups:Array<Module>;
public interfaces:any;
public additionalInformation:any;
@@ -92,6 +94,9 @@ export class ComponentGenericResponse implements Serializable<ComponentGenericR
if(response.groups) {
this.groups = CommonUtils.initModules(response.groups);
}
+ if(response.policies) {
+ this.policies = CommonUtils.initPolicies(response.policies);
+ }
return this;
}
}
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