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 export class InputOperationParameter {
26 toscaDefaultValue?: string;
28 constructor(param?: any) {
30 this.name = param.name;
31 this.type = param.type;
32 this.inputId = param.inputId;
33 this.toscaDefaultValue = param.toscaDefaultValue;
35 console.info("InputOperationParameter Constructor: ", param)
39 export interface IOperationParamsList {
40 listToscaDataDefinition: Array<InputOperationParameter>;
43 export class BEInterfaceOperationModel {
47 inputs: IOperationParamsList;
48 implementation?: InterfaceOperationImplementation;
50 constructor(operation?: any) {
52 this.name = operation.name;
53 this.description = operation.description;
54 this.uniqueId = operation.uniqueId;
55 this.inputs = operation.inputs;
56 this.implementation = operation.implementation;
61 export class InterfaceOperationModel extends BEInterfaceOperationModel {
62 interfaceType: string;
64 operationType: string;
67 implementation?: InterfaceOperationImplementation;
68 inputParams: IOperationParamsList;
70 constructor(operation?: any) {
73 this.interfaceId = operation.interfaceId;
74 this.interfaceType = operation.interfaceType;
75 this.description = operation.description;
76 this.operationType = operation.operationType;
77 this.uniqueId = operation.uniqueId;
78 this.inputParams = operation.inputParams;
82 public displayType(): string {
83 return displayType(this.interfaceType);
87 export class InterfaceOperationImplementation {
91 export class ComponentInstanceInterfaceModel {
94 operations: Array<InterfaceOperationModel>;
96 constructor(interfaceOperation?: any) {
97 if (interfaceOperation) {
98 this.type = interfaceOperation.type;
99 this.uniqueId = interfaceOperation.uniqueId;
100 this.operations = interfaceOperation.operations;
104 public displayType(): string {
105 return displayType(this.type);
109 const displayType = (type:string) => type && type.substr(type.lastIndexOf('.') + 1);