Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / mso / rest / Request.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 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.mso.rest;
22
23 import com.fasterxml.jackson.annotation.*;
24 import org.apache.commons.lang.builder.EqualsBuilder;
25 import org.apache.commons.lang.builder.ToStringBuilder;
26 import org.apache.commons.lang3.builder.HashCodeBuilder;
27
28 import java.util.HashMap;
29 import java.util.Map;
30
31
32 /**
33  * request structure.
34  */
35 @JsonInclude(JsonInclude.Include.NON_NULL)
36 @JsonPropertyOrder({
37     "finishTime",
38     "instanceIds",
39     "requestDetails",
40     "requestId",
41     "requestScope",
42     "requestStatus",
43     "requestType",
44     "startTime"
45 })
46 public class Request {
47
48  
49     /** The instance ids. */
50     @JsonProperty("instanceIds")
51     private InstanceIds instanceIds;
52     
53     /** The request details. */
54     @JsonProperty("requestDetails")
55     private RequestDetails requestDetails;
56     
57     /** The request status. */
58     @JsonProperty("requestStatus")
59     private RequestStatus requestStatus;
60
61     /**
62      * Date and time the request was finished in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT
63      *
64      */
65     @JsonProperty("finishTime")
66     private String finishTime;
67
68     /**
69      * UUID for the request generated by the instantiation service
70      * (Required)
71      *
72      */
73     @JsonProperty("requestId")
74     private String requestId;
75
76     /**
77      * short description of the entity being operated on
78      * (Required)
79      *
80      */
81     @JsonProperty("requestScope")
82     private String requestScope;
83
84     /**
85      * short description of the action being performed on the requestScope
86      * (Required)
87      *
88      */
89     @JsonProperty("requestType")
90     private String requestType;
91
92     /**
93      * Date and time the request was created in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT
94      * (Required)
95      *
96      */
97     @JsonProperty("startTime")
98     private String startTime;
99
100     @JsonIgnore
101     private Map<String, Object> additionalProperties = new HashMap<>();
102
103
104     /* (non-Javadoc)
105      * @see org.openecomp.vid.domain.mso.Request#getInstanceIds()
106      */
107     @JsonProperty("instanceIds")
108     public InstanceIds getInstanceIds() {
109         return instanceIds;
110     }
111
112     /**
113      * Sets the instance ids.
114      *
115      * @param instanceIds     The instanceIds
116      */
117     @JsonProperty("instanceIds")
118     public void setInstanceIds(InstanceIds instanceIds) {
119         this.instanceIds = instanceIds;
120     }
121
122     /**
123      * (Required).
124      *
125      * @return     The requestDetails
126      */
127     @JsonProperty("requestDetails")
128     public RequestDetails getRequestDetails() {
129         return requestDetails;
130     }
131
132     /**
133      * (Required).
134      *
135      * @param requestDetails     The requestDetails
136      */
137     @JsonProperty("requestDetails")
138     public void setRequestDetails(RequestDetails requestDetails) {
139         this.requestDetails = requestDetails;
140     }
141
142     
143     /**
144      * Gets the request status.
145      *
146      * @return     The requestStatus
147      */
148     @JsonProperty("requestStatus")
149     public RequestStatus getRequestStatus() {
150         return requestStatus;
151     }
152
153     /**
154      * Sets the request status.
155      *
156      * @param requestStatus     The requestStatus
157      */
158     @JsonProperty("requestStatus")
159     public void setRequestStatus(RequestStatus requestStatus) {
160         this.requestStatus = requestStatus;
161     }
162
163     /**
164      * Date and time the request was finished in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT
165      *
166      * @return
167      *     The finishTime
168      */
169     @JsonProperty("finishTime")
170     public String getFinishTime() {
171         return finishTime;
172     }
173
174     /**
175      * Date and time the request was finished in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT
176      *
177      * @param finishTime
178      *     The finishTime
179      */
180     @JsonProperty("finishTime")
181     public void setFinishTime(String finishTime) {
182         this.finishTime = finishTime;
183     }
184
185     /**
186      * UUID for the request generated by the instantiation service
187      * (Required)
188      *
189      * @return
190      *     The requestId
191      */
192     @JsonProperty("requestId")
193     public String getRequestId() {
194         return requestId;
195     }
196
197     /**
198      * UUID for the request generated by the instantiation service
199      * (Required)
200      *
201      * @param requestId
202      *     The requestId
203      */
204     @JsonProperty("requestId")
205     public void setRequestId(String requestId) {
206         this.requestId = requestId;
207     }
208
209     /**
210      * short description of the entity being operated on
211      * (Required)
212      *
213      * @return
214      *     The requestScope
215      */
216     @JsonProperty("requestScope")
217     public String getRequestScope() {
218         return requestScope;
219     }
220
221     /**
222      * short description of the entity being operated on
223      * (Required)
224      *
225      * @param requestScope
226      *     The requestScope
227      */
228     @JsonProperty("requestScope")
229     public void setRequestScope(String requestScope) {
230         this.requestScope = requestScope;
231     }
232
233     /**
234      * short description of the action being performed on the requestScope
235      * (Required)
236      *
237      * @return
238      *     The requestType
239      */
240     @JsonProperty("requestType")
241     public String getRequestType() {
242         return requestType;
243     }
244
245     /**
246      * short description of the action being performed on the requestScope
247      * (Required)
248      *
249      * @param requestType
250      *     The requestType
251      */
252     @JsonProperty("requestType")
253     public void setRequestType(String requestType) {
254         this.requestType = requestType;
255     }
256
257     /**
258      * Date and time the request was created in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT
259      * (Required)
260      *
261      * @return
262      *     The startTime
263      */
264     @JsonProperty("startTime")
265     public String getStartTime() {
266         return startTime;
267     }
268
269     /**
270      * Date and time the request was created in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT
271      * (Required)
272      *
273      * @param startTime
274      *     The startTime
275      */
276     @JsonProperty("startTime")
277     public void setStartTime(String startTime) {
278         this.startTime = startTime;
279     }
280
281     @Override
282     public String toString() {
283         return ToStringBuilder.reflectionToString(this);
284     }
285
286     @JsonAnyGetter
287     public Map<String, Object> getAdditionalProperties() {
288         return this.additionalProperties;
289     }
290
291     @JsonAnySetter
292     public void setAdditionalProperty(String name, Object value) {
293         this.additionalProperties.put(name, value);
294     }
295
296     @Override
297     public int hashCode() {
298         return new HashCodeBuilder(17, 37).append(getFinishTime()).append(getInstanceIds()).append(getRequestDetails()).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode();
299     }
300
301     @Override
302     public boolean equals(Object other) {
303         if (other == this) {
304             return true;
305         }
306         if (!(other instanceof Request)) {
307             return false;
308         }
309         Request rhs = ((Request) other);
310         return new EqualsBuilder().append(getFinishTime(), rhs.getFinishTime()).append(getInstanceIds(), rhs.getInstanceIds()).append(getRequestDetails(), rhs.getRequestDetails()).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
311     }
312
313 }