2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 Nordix Foundation
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 * SPDX-License-Identifier: Apache-2.0
17 * ============LICENSE_END=========================================================
22 import {ArtifactModel} from "./artifacts";
24 export class InputOperationParameter {
28 toscaDefaultValue?: string;
30 constructor(param?: any) {
32 this.name = param.name;
33 this.type = param.type;
34 this.inputId = param.inputId;
35 this.toscaDefaultValue = param.toscaDefaultValue;
37 console.info("InputOperationParameter Constructor: ", param)
41 export class PropertyOperationParameter {
47 constructor(param?: any) {
49 this.name = param.name;
50 this.type = param.type;
51 this.value = param.value;
52 this.propertyId = param.propertyId;
57 export interface IOperationParamsList {
58 listToscaDataDefinition: Array<InputOperationParameter>;
61 export class BEInterfaceOperationModel {
65 inputs: IOperationParamsList;
66 implementation: ArtifactModel;
68 constructor(operation?: any) {
70 this.name = operation.name;
71 this.description = operation.description;
72 this.uniqueId = operation.uniqueId;
73 this.inputs = operation.inputs;
74 this.implementation = operation.implementation;
79 export class InterfaceOperationModel extends BEInterfaceOperationModel {
80 interfaceType: string;
82 operationType: string;
85 inputParams: IOperationParamsList;
86 implementation: ArtifactModel;
88 constructor(operation?: any) {
91 this.interfaceId = operation.interfaceId;
92 this.interfaceType = operation.interfaceType;
93 this.description = operation.description;
94 this.operationType = operation.operationType;
95 this.uniqueId = operation.uniqueId;
96 this.inputParams = operation.inputParams;
97 this.implementation = operation.implementation;
101 public displayType(): string {
102 return displayType(this.interfaceType);
106 export class ComponentInstanceInterfaceModel {
109 operations: Array<InterfaceOperationModel>;
111 constructor(interfaceOperation?: any) {
112 if (interfaceOperation) {
113 this.type = interfaceOperation.type;
114 this.uniqueId = interfaceOperation.uniqueId;
115 this.operations = interfaceOperation.operations;
119 public displayType(): string {
120 return displayType(this.type);
124 const displayType = (type:string) => type && type.substr(type.lastIndexOf('.') + 1);