summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/models')
-rw-r--r--catalog-ui/src/app/models/components/component.ts4
-rw-r--r--catalog-ui/src/app/models/operation.ts51
2 files changed, 54 insertions, 1 deletions
diff --git a/catalog-ui/src/app/models/components/component.ts b/catalog-ui/src/app/models/components/component.ts
index b7f57227ca..adcf498342 100644
--- a/catalog-ui/src/app/models/components/component.ts
+++ b/catalog-ui/src/app/models/components/component.ts
@@ -23,7 +23,7 @@
import * as _ from "lodash";
import {AsdcComment, ArtifactModel, ArtifactGroupModel, IFileDownload, PropertyModel, PropertiesGroup, AttributeModel, AttributesGroup, ComponentInstance,
InputModel, DisplayModule, Module, IValidate, RelationshipModel, IMainCategory, RequirementsGroup, CapabilitiesGroup, AdditionalInformationModel,
- Resource, IAppMenu, Service} from "../../models";
+ Resource, IAppMenu, OperationModel, Service} from "../../models";
import {IComponentService} from "../../services/components/component-service";
import {CommonUtils} from "../../utils/common-utils";
@@ -134,6 +134,7 @@ export abstract class Component implements IComponent {
public deploymentArtifacts:ArtifactGroupModel;
public artifacts:ArtifactGroupModel;
public toscaArtifacts:ArtifactGroupModel;
+ public interfaceOperations:Array<OperationModel>;
public distributionStatus:string;
public categories:Array<IMainCategory>;
public categoryNormalizedName: string;
@@ -178,6 +179,7 @@ export abstract class Component implements IComponent {
this.additionalInformation = component.additionalInformation;
this.artifacts = new ArtifactGroupModel(component.artifacts);
this.toscaArtifacts = new ArtifactGroupModel(component.toscaArtifacts);
+ this.interfaceOperations = component.interfaceOperations;
this.contactId = component.contactId;
this.categories = component.categories;
this.categoryNormalizedName = component.categoryNormalizedName;
diff --git a/catalog-ui/src/app/models/operation.ts b/catalog-ui/src/app/models/operation.ts
new file mode 100644
index 0000000000..55fcd82320
--- /dev/null
+++ b/catalog-ui/src/app/models/operation.ts
@@ -0,0 +1,51 @@
+'use strict';
+
+export class OperationParam {
+ paramName: string = '';
+ paramId: string = '';
+
+ constructor(param?: OperationParam) {
+ if (param) {
+ this.paramId = param.paramId;
+ this.paramName = param.paramName;
+ }
+ }
+}
+
+export interface IOperationParamsList {
+ listToscaDataDefinition: Array<OperationParam>;
+}
+
+export class OperationModel {
+ description: string;
+ inputParams: IOperationParamsList;
+ operationType: string;
+ outputParams: IOperationParamsList;
+ uniqueId: string;
+
+ constructor(operation?: any) {
+ if (operation) {
+ this.description = operation.description;
+ this.inputParams = operation.inputParams;
+ this.operationType = operation.operationType;
+ this.outputParams = operation.outputParams;
+ this.uniqueId = operation.uniqueId;
+ }
+ }
+
+ public createInputParamsList(inputParams: Array<OperationParam>): void {
+ this.inputParams = {
+ listToscaDataDefinition: inputParams
+ };
+ }
+
+ public createOutputParamsList(outputParams: Array<OperationParam>): void {
+ this.outputParams = {
+ listToscaDataDefinition: outputParams
+ };
+ }
+}
+
+export interface CreateOperationResponse extends OperationModel {
+ artifactUUID: string;
+}