Add serviceOrder rest services
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / ServiceOrderItem.java
1 /*
2  * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
3  * open API16.5 + applied TMF guideline 3.0
4  *
5  * OpenAPI spec version: 0.1.1_inProgress
6  * 
7  *
8  * NOTE: This class is auto generated by the swagger code generator program.
9  * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
12  * in compliance with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software distributed under the License
17  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
18  * or implied. See the License for the specific language governing permissions and limitations under
19  * the License.
20  */
21
22
23 package org.onap.nbi.apis.serviceorder.model;
24
25 import com.fasterxml.jackson.annotation.JsonIgnore;
26 import com.fasterxml.jackson.annotation.JsonProperty;
27 import io.swagger.annotations.ApiModel;
28 import io.swagger.annotations.ApiModelProperty;
29 import javax.validation.constraints.NotNull;
30 import java.util.ArrayList;
31 import java.util.List;
32 import java.util.Objects;
33
34 /**
35  * An identified part of the order. A service order is decomposed into one or more order items.
36  */
37 @ApiModel(description = "An identified part of the order. A service order is decomposed into one or more order items.")
38 @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
39         date = "2018-02-19T14:00:30.767Z")
40 public class ServiceOrderItem {
41     @JsonProperty("id")
42     private String id = null;
43
44     @JsonProperty("action")
45     private ActionType action = null;
46
47     @JsonProperty("state")
48     private StateType state = null;
49
50     @JsonProperty("@type")
51     private String type = null;
52
53     @JsonProperty("@schemaLocation")
54     private String schemaLocation = null;
55
56     @JsonProperty("@baseType")
57     private String baseType = null;
58
59     @JsonIgnore
60     private String requestId;
61
62     @JsonProperty("orderItemRelationship")
63     private List<OrderItemRelationship> orderItemRelationship = new ArrayList<>();
64
65     @JsonProperty("service")
66     private Service service = null;
67
68     public ServiceOrderItem id(String id) {
69         this.id = id;
70         return this;
71     }
72
73     /**
74      * Identifier of the line item (generally it is a sequence number 01, 02, 03, …)
75      * 
76      * @return id
77      **/
78     @JsonProperty("id")
79     @ApiModelProperty(required = true,
80             value = "Identifier of the line item (generally it is a sequence number 01, 02, 03, …)")
81     @NotNull
82     public String getId() {
83         return id;
84     }
85
86     public void setId(String id) {
87         this.id = id;
88     }
89
90     public ServiceOrderItem action(ActionType action) {
91         this.action = action;
92         return this;
93     }
94
95     /**
96      * The action to be carried out on the Service. Can be add, modify, delete, noChange
97      * 
98      * @return action
99      **/
100     @JsonProperty("action")
101     @ApiModelProperty(value = "The action to be carried out on the Service. Can be add, modify, delete, noChange")
102     public ActionType getAction() {
103         return action;
104     }
105
106     public void setAction(ActionType action) {
107         this.action = action;
108     }
109
110     public ServiceOrderItem state(StateType state) {
111         this.state = state;
112         return this;
113     }
114
115     /**
116      * State of the order item (described in the state machine diagram)
117      * 
118      * @return state
119      **/
120     @JsonProperty("state")
121     @ApiModelProperty(value = "State of the order item (described in the state machine diagram)")
122     public StateType getState() {
123         return state;
124     }
125
126     public void setState(StateType state) {
127         this.state = state;
128     }
129
130     public ServiceOrderItem type(String type) {
131         this.type = type;
132         return this;
133     }
134
135     /**
136      * 
137      * @return type
138      **/
139     @JsonProperty("@type")
140     @ApiModelProperty(value = "")
141     public String getType() {
142         return type;
143     }
144
145     public void setType(String type) {
146         this.type = type;
147     }
148
149     public ServiceOrderItem schemaLocation(String schemaLocation) {
150         this.schemaLocation = schemaLocation;
151         return this;
152     }
153
154     /**
155      * 
156      * @return schemaLocation
157      **/
158     @JsonProperty("@schemaLocation")
159     @ApiModelProperty(value = "")
160     public String getSchemaLocation() {
161         return schemaLocation;
162     }
163
164     public void setSchemaLocation(String schemaLocation) {
165         this.schemaLocation = schemaLocation;
166     }
167
168     public ServiceOrderItem baseType(String baseType) {
169         this.baseType = baseType;
170         return this;
171     }
172
173     /**
174      * 
175      * @return baseType
176      **/
177     @JsonProperty("@baseType")
178     @ApiModelProperty(value = "")
179     public String getBaseType() {
180         return baseType;
181     }
182
183     public void setBaseType(String baseType) {
184         this.baseType = baseType;
185     }
186
187     public ServiceOrderItem orderItemRelationship(List<OrderItemRelationship> orderItemRelationship) {
188         this.orderItemRelationship = orderItemRelationship;
189         return this;
190     }
191
192     public ServiceOrderItem addOrderItemRelationshipItem(OrderItemRelationship orderItemRelationshipItem) {
193         if (this.orderItemRelationship == null) {
194             this.orderItemRelationship = new ArrayList<OrderItemRelationship>();
195         }
196         this.orderItemRelationship.add(orderItemRelationshipItem);
197         return this;
198     }
199
200     /**
201      * Linked order item to the one containing this attribute
202      * 
203      * @return orderItemRelationship
204      **/
205     @JsonProperty("orderItemRelationship")
206     @ApiModelProperty(value = "Linked order item to the one containing this attribute")
207     public List<OrderItemRelationship> getOrderItemRelationship() {
208         return orderItemRelationship;
209     }
210
211     public void setOrderItemRelationship(List<OrderItemRelationship> orderItemRelationship) {
212         this.orderItemRelationship = orderItemRelationship;
213     }
214
215     public ServiceOrderItem service(Service service) {
216         this.service = service;
217         return this;
218     }
219
220     /**
221      * The Service to be acted on by the order item
222      * 
223      * @return service
224      **/
225     @JsonProperty("service")
226     @ApiModelProperty(required = true, value = "The Service to be acted on by the order item")
227     @NotNull
228     public Service getService() {
229         return service;
230     }
231
232     public void setService(Service service) {
233         this.service = service;
234     }
235
236
237     public String getRequestId() {
238         return requestId;
239     }
240
241     public void setRequestId(String requestId) {
242         this.requestId = requestId;
243     }
244
245     @Override
246     public boolean equals(java.lang.Object o) {
247         if (this == o) {
248             return true;
249         }
250         if (o == null || getClass() != o.getClass()) {
251             return false;
252         }
253         ServiceOrderItem serviceOrderItem = (ServiceOrderItem) o;
254         return Objects.equals(this.id, serviceOrderItem.id) && Objects.equals(this.action, serviceOrderItem.action)
255                 && Objects.equals(this.state, serviceOrderItem.state)
256                 && Objects.equals(this.type, serviceOrderItem.type)
257                 && Objects.equals(this.schemaLocation, serviceOrderItem.schemaLocation)
258                 && Objects.equals(this.baseType, serviceOrderItem.baseType)
259                 && Objects.equals(this.orderItemRelationship, serviceOrderItem.orderItemRelationship)
260                 && Objects.equals(this.service, serviceOrderItem.service)
261                 && Objects.equals(this.requestId, serviceOrderItem.requestId);
262     }
263
264     @Override
265     public int hashCode() {
266         return Objects.hash(id, action, state, type, schemaLocation, baseType, orderItemRelationship, service,
267                 requestId);
268     }
269
270
271     @Override
272     public String toString() {
273         StringBuilder sb = new StringBuilder();
274         sb.append("class ServiceOrderItem {\n");
275
276         sb.append("    id: ").append(toIndentedString(id)).append("\n");
277         sb.append("    action: ").append(toIndentedString(action)).append("\n");
278         sb.append("    state: ").append(toIndentedString(state)).append("\n");
279         sb.append("    type: ").append(toIndentedString(type)).append("\n");
280         sb.append("    schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
281         sb.append("    baseType: ").append(toIndentedString(baseType)).append("\n");
282         sb.append("    orderItemRelationship: ").append(toIndentedString(orderItemRelationship)).append("\n");
283         sb.append("    requestId: ").append(toIndentedString(requestId)).append("\n");
284         sb.append("    service: ").append(toIndentedString(service)).append("\n");
285         sb.append("}");
286         return sb.toString();
287     }
288
289     /**
290      * Convert the given object to string with each line indented by 4 spaces (except the first
291      * line).
292      */
293     private String toIndentedString(java.lang.Object o) {
294         if (o == null) {
295             return "null";
296         }
297         return o.toString().replace("\n", "\n    ");
298     }
299 }
300