b88c3f6f6326ad7649d1acd78421d485daa05111
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / SOWorkflows.kt
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.vid.model
22
23 data class SOWorkflow constructor(
24         val id: Long,
25         val name: String) {
26     fun clone(): SOWorkflow {
27         return copy()
28     }
29 }
30
31 data class SOWorkflows @JvmOverloads constructor(
32         val workflows: List<SOWorkflow> = emptyList()) {
33     fun clone(): SOWorkflows {
34         return copy(workflows.toMutableList())
35     }
36 }
37
38 enum class SOWorkflowType(
39         val type: String) {
40     STRING("STRING")
41 }
42
43 enum class LocalWorkflowType(
44         val type: String) {
45     STRING("STRING"),
46     FILE("FILE")
47 }
48
49 data class SOWorkflowParameterDefinition constructor(
50         val id: Long,
51         val name: String,
52         val pattern: String,
53         val type: SOWorkflowType,
54         val required: Boolean)
55
56 data class SOWorkflowParameterDefinitions constructor(
57         val parameterDefinitions: List<SOWorkflowParameterDefinition> = emptyList()) {
58     fun clone(): SOWorkflowParameterDefinitions {
59         return copy(parameterDefinitions.toMutableList())
60     }
61 }
62
63 data class LocalWorkflowParameterDefinition @JvmOverloads constructor(
64         val id: Long,
65         val name: String,
66         val required: Boolean,
67         val type: LocalWorkflowType,
68         val pattern: String? = null,
69         val msgOnPatternError: String? = null,
70         val msgOnContentError: String? = null,
71         val acceptableFileType: String? = null
72 )
73
74 data class LocalWorkflowParameterDefinitions constructor(
75         val parameterDefinitions: List<LocalWorkflowParameterDefinition> = emptyList()
76 ) {
77     fun clone(): LocalWorkflowParameterDefinitions {
78         return copy(parameterDefinitions.toMutableList())
79     }
80 }
81