Arielk | 802bd2a | 2018-04-16 15:37:39 +0300 | [diff] [blame^] | 1 | 'use strict'; |
| 2 | |
| 3 | export class OperationParam { |
| 4 | paramName: string = ''; |
| 5 | paramId: string = ''; |
| 6 | |
| 7 | constructor(param?: OperationParam) { |
| 8 | if (param) { |
| 9 | this.paramId = param.paramId; |
| 10 | this.paramName = param.paramName; |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | export interface IOperationParamsList { |
| 16 | listToscaDataDefinition: Array<OperationParam>; |
| 17 | } |
| 18 | |
| 19 | export class OperationModel { |
| 20 | description: string; |
| 21 | inputParams: IOperationParamsList; |
| 22 | operationType: string; |
| 23 | outputParams: IOperationParamsList; |
| 24 | uniqueId: string; |
| 25 | |
| 26 | constructor(operation?: any) { |
| 27 | if (operation) { |
| 28 | this.description = operation.description; |
| 29 | this.inputParams = operation.inputParams; |
| 30 | this.operationType = operation.operationType; |
| 31 | this.outputParams = operation.outputParams; |
| 32 | this.uniqueId = operation.uniqueId; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | public createInputParamsList(inputParams: Array<OperationParam>): void { |
| 37 | this.inputParams = { |
| 38 | listToscaDataDefinition: inputParams |
| 39 | }; |
| 40 | } |
| 41 | |
| 42 | public createOutputParamsList(outputParams: Array<OperationParam>): void { |
| 43 | this.outputParams = { |
| 44 | listToscaDataDefinition: outputParams |
| 45 | }; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | export interface CreateOperationResponse extends OperationModel { |
| 50 | artifactUUID: string; |
| 51 | } |