summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/services/responses
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-06-09 03:19:04 +0300
committerMichael Lando <ml636r@att.com>2017-06-09 03:19:04 +0300
commited64b5edff15e702493df21aa3230b81593e6133 (patch)
treea4cb01fdaccc34930a8db403a3097c0d1e40914b /catalog-ui/src/app/ng2/services/responses
parent280f8015d06af1f41a3ef12e8300801c7a5e0d54 (diff)
[SDC-29] catalog 1707 rebase commit.
Change-Id: I43c3dc5cf44abf5da817649bc738938a3e8388c1 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/services/responses')
-rw-r--r--catalog-ui/src/app/ng2/services/responses/component-generic-response.ts77
-rw-r--r--catalog-ui/src/app/ng2/services/responses/properties.response.ts7
2 files changed, 84 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
new file mode 100644
index 0000000000..7dcd95d712
--- /dev/null
+++ b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts
@@ -0,0 +1,77 @@
+/**
+ * Created by ob0695 on 4/18/2017.
+ */
+
+import { ArtifactGroupModel, PropertyModel, PropertiesGroup, AttributeModel, AttributesGroup, ComponentInstance,
+ InputModel, Module, ComponentMetadata, RelationshipModel, RequirementsGroup, CapabilitiesGroup,InputFEModel} from "app/models";
+import {CommonUtils} from "app/utils";
+import {Serializable} from "../utils/serializable";
+import {PropertyBEModel} from "../../../models/properties-inputs/property-be-model";
+
+export class ComponentGenericResponse implements Serializable<ComponentGenericResponse> {
+
+ public metadata: ComponentMetadata;
+ public deploymentArtifacts:ArtifactGroupModel;
+ public artifacts:ArtifactGroupModel;
+ public toscaArtifacts:ArtifactGroupModel;
+ public componentInstancesProperties:PropertiesGroup;
+ public componentInstancesAttributes:AttributesGroup;
+ public componentInstancesRelations:Array<RelationshipModel>;
+ public componentInstances:Array<ComponentInstance>;
+ public inputs:Array<PropertyBEModel>;
+ public capabilities:CapabilitiesGroup;
+ public requirements:RequirementsGroup;
+ public properties:Array<PropertyModel>;
+ public attributes:Array<AttributeModel>;
+ public groups:Array<Module>;
+ public interfaces:any;
+ public additionalInformation:any;
+ public derivedList:Array<any>;
+
+ deserialize (response): ComponentGenericResponse {
+
+ if(response.componentInstancesProperties) {
+ this.componentInstancesProperties = new PropertiesGroup(response.componentInstancesProperties);
+ }
+ if(response.componentInstancesAttributes) {
+ this.componentInstancesAttributes = new AttributesGroup(response.componentInstancesAttributes);
+ }
+ if(response.componentInstances) {
+ this.componentInstances = CommonUtils.initComponentInstances(response.componentInstances);
+ }
+ if(response.componentInstancesRelations) {
+ this.componentInstancesRelations = CommonUtils.initComponentInstanceRelations(response.componentInstancesRelations);
+ }
+ if(response.deploymentArtifacts) {
+ this.deploymentArtifacts = new ArtifactGroupModel(response.deploymentArtifacts);
+ }
+ if(response.inputs) {
+ this.inputs = CommonUtils.initInputs(response.inputs);
+ }
+ if(response.attributes) {
+ this.attributes = CommonUtils.initAttributes(response.attributes);
+ }
+ if(response.artifacts) {
+ this.artifacts = new ArtifactGroupModel(response.artifacts);
+ }
+ if(response.properties) {
+ this.properties = CommonUtils.initProperties(response.properties);
+ }
+ if(response.capabilities) {
+ this.capabilities = new CapabilitiesGroup(response.capabilities);
+ }
+ if(response.requirements) {
+ this.requirements = new RequirementsGroup(response.requirements);
+ }
+ if(response.toscaArtifacts) {
+ this.toscaArtifacts = new ArtifactGroupModel(response.toscaArtifacts);
+ }
+ if(response.metadata) {
+ this.metadata = new ComponentMetadata().deserialize(response.metadata);
+ }
+ if(response.groups) {
+ this.groups = CommonUtils.initModules(response.groups);
+ }
+ return this;
+ }
+}
diff --git a/catalog-ui/src/app/ng2/services/responses/properties.response.ts b/catalog-ui/src/app/ng2/services/responses/properties.response.ts
new file mode 100644
index 0000000000..a3d82500eb
--- /dev/null
+++ b/catalog-ui/src/app/ng2/services/responses/properties.response.ts
@@ -0,0 +1,7 @@
+export class PropertiesResponse {
+ properties: Array<Property>;
+}
+
+class Property {
+ name: string
+}