Implant vid-app-common org.onap.vid.job (main and test)
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / VidNotions.kt
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T 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 import com.fasterxml.jackson.annotation.JsonInclude
24 import com.fasterxml.jackson.annotation.JsonProperty
25 import com.fasterxml.jackson.annotation.JsonValue
26 import com.google.common.base.CaseFormat
27
28 class VidNotions(@get:JsonInclude(JsonInclude.Include.NON_NULL)
29                  val instantiationUI: InstantiationUI,
30                  val modelCategory: ModelCategory,
31                  val viewEditUI: InstantiationUI,
32                  val instantiationType: InstantiationType) {
33     enum class InstantiationUI {
34         NETWORK_WITH_PROPERTY_NETWORK_TECHNOLOGY_EQUALS_STANDARD_SRIOV_OR_OVS,
35         SERVICE_WITH_FABRIC_CONFIGURATION,
36         LEGACY,
37         SERVICE_UUID_IS_1ffce89f_ef3f_4cbb_8b37_82134590c5de,
38         ANY_ALACARTE_NEW_UI,
39         MACRO_SERVICE,
40         SERVICE_WITH_VNF_GROUPING,
41         TRANSPORT_SERVICE,
42         SERVICE_WITH_COLLECTION_RESOURCE,
43         A_LA_CARTE_VNF_SERVICE_ROLE,
44         INFRASTRUCTURE_VPN
45         ;
46
47         @JsonValue
48         fun toLowerCamel(): String {
49             return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, this.name)
50         }
51
52     }
53
54     enum class ModelCategory {
55         @JsonProperty("5G Provider Network")
56         IS_5G_PROVIDER_NETWORK_MODEL,
57         @JsonProperty("5G Fabric Configuration")
58         IS_5G_FABRIC_CONFIGURATION_MODEL,
59         Transport,
60         SERVICE_WITH_COLLECTION_RESOURCE,
61         INFRASTRUCTURE_VPN,
62         @JsonProperty("other")
63         OTHER
64     }
65
66     enum class InstantiationType {
67         Macro,
68         ALaCarte,
69         ClientConfig
70     }
71 }