blob: 0a26b3b450f18820184d72efd694be5707e39269 [file] [log] [blame]
Aharoni, Pavel (pa0916)ca3cb012018-10-22 15:29:57 +03001/*-
2 * ============LICENSE_START=======================================================
3 * OSAM
4 * ================================================================================
5 * Copyright (C) 2018 AT&T
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
22
23package org.onap.osam.mso.rest.OperationalEnvironment;
24
25
26import com.fasterxml.jackson.annotation.JsonProperty;
27import com.fasterxml.jackson.annotation.JsonTypeInfo;
28import com.fasterxml.jackson.annotation.JsonTypeName;
29
30import java.util.List;
31
32public class OperationEnvironmentRequestDetails {
33 private final RequestInfo requestInfo;
34 private final List<RelatedInstance> relatedInstanceList;
35 private final RequestParameters requestParameters;
36
37 public OperationEnvironmentRequestDetails(@JsonProperty(value = "requestInfo", required = true) RequestInfo requestInfo,
38 @JsonProperty(value = "relatedInstanceList", required = true) List<RelatedInstance> relatedInstanceList,
39 @JsonProperty(value = "requestParameters", required = true) RequestParameters requestParameters) {
40 this.requestInfo = requestInfo;
41 this.relatedInstanceList = relatedInstanceList;
42 this.requestParameters = requestParameters;
43 }
44
45 public RequestInfo getRequestInfo() {
46 return requestInfo;
47 }
48
49 public List<RelatedInstance> getRelatedInstanceList() {
50 return relatedInstanceList;
51 }
52
53 public RequestParameters getRequestParameters() {
54 return requestParameters;
55 }
56
57 public static class RequestInfo {
58 private final String resourceType;
59 private final String instanceName;
60 private final String source;
61 private final String requestorId;
62
63 public RequestInfo(@JsonProperty(value = "resourceType", required = true) String resourceType,
64 @JsonProperty(value = "instanceName", required = true) String instanceName,
65 @JsonProperty(value = "source", required = true) String source,
66 @JsonProperty(value = "requestorId", required = true) String requestorId) {
67 this.resourceType = resourceType;
68 this.instanceName = instanceName;
69 this.source = source;
70 this.requestorId = requestorId;
71 }
72
73 public String getResourceType() {
74 return resourceType;
75 }
76
77 public String getInstanceName() {
78 return instanceName;
79 }
80
81 public String getSource() {
82 return source;
83 }
84
85 public String getRequestorId() {
86 return requestorId;
87 }
88 }
89
90 public static class RequestParameters {
91 private final String operationalEnvironmentType;
92 private final String tenantContext;
93 private final String workloadContext;
94
95 public RequestParameters(@JsonProperty(value = "operationalEnvironmentType", required = true) String operationalEnvironmentType,
96 @JsonProperty(value = "tenantContext", required = true) String tenantContext,
97 @JsonProperty(value = "workloadContext", required = true) String workloadContext) {
98 this.operationalEnvironmentType = operationalEnvironmentType;
99 this.tenantContext = tenantContext;
100 this.workloadContext = workloadContext;
101 }
102 public String getOperationalEnvironmentType() {
103 return operationalEnvironmentType;
104 }
105
106 public String getTenantContext() {
107 return tenantContext;
108 }
109
110 public String getWorkloadContext() {
111 return workloadContext;
112 }
113 }
114
115 @JsonTypeName("relatedInstance")
116 @JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
117 public static class RelatedInstance {
118 private final String resourceType;
119 private final String instanceId;
120 private final String instanceName;
121
122 public String getResourceType() {
123 return resourceType;
124 }
125
126 public String getInstanceId() {
127 return instanceId;
128 }
129
130 public String getInstanceName() {
131 return instanceName;
132 }
133
134 public RelatedInstance(@JsonProperty(value = "instanceName", required = true) String resourceType,
135 @JsonProperty(value = "instanceId", required = true) String instanceId,
136 @JsonProperty(value = "instanceName", required = true) String instanceName) {
137 this.resourceType = resourceType;
138 this.instanceId = instanceId;
139 this.instanceName = instanceName;
140 }
141 }
142}