Add serviceOrder rest services
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / ServiceOrder.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 java.util.ArrayList;
26 import java.util.Date;
27 import java.util.List;
28 import java.util.Objects;
29 import org.hibernate.validator.constraints.NotEmpty;
30 import org.onap.nbi.apis.serviceorder.serviceordervalidator.ValidServiceOrder;
31 import org.onap.nbi.commons.Resource;
32 import org.springframework.data.annotation.Id;
33 import org.springframework.data.mongodb.core.mapping.Document;
34 import com.fasterxml.jackson.annotation.JsonFormat;
35 import com.fasterxml.jackson.annotation.JsonProperty;
36 import io.swagger.annotations.ApiModel;
37 import io.swagger.annotations.ApiModelProperty;
38
39 /**
40  * A Service Order is a type of order which can be used to place an order between a customer and a
41  * service provider or between a service provider and a partner and vice versa
42  */
43 @ApiModel(
44         description = "A Service Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa")
45 @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
46         date = "2018-02-19T14:00:30.767Z")
47 @Document
48 @ValidServiceOrder
49 public class ServiceOrder implements Resource {
50
51     @Id
52     @JsonProperty("id")
53     private String id = null;
54
55     @JsonProperty("href")
56     private String href = null;
57
58     @JsonProperty("externalId")
59     private String externalId = null;
60
61     @JsonProperty("priority")
62     private String priority = null;
63
64     @JsonProperty("description")
65     private String description = null;
66
67     @JsonProperty("category")
68     private String category = null;
69
70     @JsonProperty("state")
71     private StateType state = null;
72
73     @JsonProperty("orderDate")
74     private Date orderDate = null;
75
76     @JsonProperty("completionDateTime")
77     private Date completionDateTime = null;
78
79     @JsonProperty("expectedCompletionDate")
80     private Date expectedCompletionDate = null;
81
82     @JsonProperty("requestedStartDate")
83     private Date requestedStartDate = null;
84
85     @JsonProperty("requestedCompletionDate")
86     private Date requestedCompletionDate = null;
87
88     @JsonProperty("startDate")
89     private Date startDate = null;
90
91     @JsonProperty("@baseType")
92     private String baseType = null;
93
94     @JsonProperty("@type")
95     private String type = null;
96
97     @JsonProperty("@schemaLocation")
98     private String schemaLocation = null;
99
100     @JsonProperty("relatedParty")
101     private List<RelatedParty> relatedParty = null;
102
103     @JsonProperty("orderRelationship")
104     private List<OrderRelationship> orderRelationship = null;
105
106     @JsonProperty("orderItem")
107     private List<ServiceOrderItem> orderItem = null;
108
109     public ServiceOrder id(String id) {
110         this.id = id;
111         return this;
112     }
113
114
115     /**
116      * ID created on repository side
117      *
118      * @return id
119      **/
120     @Override
121     @JsonProperty("id")
122     @ApiModelProperty(required = true, value = "ID created on repository side")
123     public String getId() {
124         return id;
125     }
126
127     public void setId(String id) {
128         this.id = id;
129     }
130
131     public ServiceOrder href(String href) {
132         this.href = href;
133         return this;
134     }
135
136     /**
137      * Hyperlink to access the order
138      *
139      * @return href
140      **/
141     @JsonProperty("href")
142     @ApiModelProperty(value = "Hyperlink to access the order")
143     public String getHref() {
144         return href;
145     }
146
147     public void setHref(String href) {
148         this.href = href;
149     }
150
151     public ServiceOrder externalId(String externalId) {
152         this.externalId = externalId;
153         return this;
154     }
155
156     /**
157      * ID given by the consumer and only understandable by him (to facilitate his searches)
158      *
159      * @return externalId
160      **/
161     @JsonProperty("externalId")
162     @ApiModelProperty(value = "ID given by the consumer and only understandable by him (to facilitate his searches)")
163     public String getExternalId() {
164         return externalId;
165     }
166
167     public void setExternalId(String externalId) {
168         this.externalId = externalId;
169     }
170
171     public ServiceOrder priority(String priority) {
172         this.priority = priority;
173         return this;
174     }
175
176     /**
177      * A way that can be used by consumers to prioritize orders in Service Order Management system
178      * (from 0 to 4 : 0 is the highest priority, and 4 the lowest)
179      *
180      * @return priority
181      **/
182     @JsonProperty("priority")
183     @ApiModelProperty(
184             value = "A way that can be used by consumers to prioritize orders in Service Order Management system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)")
185     public String getPriority() {
186         return priority;
187     }
188
189     public void setPriority(String priority) {
190         this.priority = priority;
191     }
192
193     public ServiceOrder description(String description) {
194         this.description = description;
195         return this;
196     }
197
198     /**
199      * A free-text description of the service order
200      *
201      * @return description
202      **/
203     @JsonProperty("description")
204     @ApiModelProperty(value = "A free-text description of the service order")
205     public String getDescription() {
206         return description;
207     }
208
209     public void setDescription(String description) {
210         this.description = description;
211     }
212
213     public ServiceOrder category(String category) {
214         this.category = category;
215         return this;
216     }
217
218     /**
219      * Used to categorize the order that can be useful for the OM system (e.g. “broadband”,
220      * “TVOption”, ...)
221      *
222      * @return category
223      **/
224     @JsonProperty("category")
225     @ApiModelProperty(
226             value = "Used to categorize the order that can be useful for the OM system (e.g. “broadband”, “TVOption”, ...)")
227     public String getCategory() {
228         return category;
229     }
230
231     public void setCategory(String category) {
232         this.category = category;
233     }
234
235     public ServiceOrder state(StateType state) {
236         this.state = state;
237         return this;
238     }
239
240     /**
241      * State of the order : described in the state-machine diagram
242      *
243      * @return state
244      **/
245     @JsonProperty("state")
246     @ApiModelProperty(value = "State of the order : described in the state-machine diagram")
247     public StateType getState() {
248         return state;
249     }
250
251     public void setState(StateType state) {
252         this.state = state;
253     }
254
255     public ServiceOrder orderDate(Date orderDate) {
256         this.orderDate = orderDate;
257         return this;
258     }
259
260     /**
261      * @return orderDate
262      **/
263     @JsonProperty("orderDate")
264     @ApiModelProperty(value = "")
265     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
266     public Date getOrderDate() {
267         return orderDate;
268     }
269
270     public void setOrderDate(Date orderDate) {
271         this.orderDate = orderDate;
272     }
273
274     public ServiceOrder completionDateTime(Date completionDateTime) {
275         this.completionDateTime = completionDateTime;
276         return this;
277     }
278
279     /**
280      * Date when the order was completed
281      *
282      * @return completionDateTime
283      **/
284     @JsonProperty("completionDateTime")
285     @ApiModelProperty(value = "Date when the order was completed")
286     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
287     public Date getCompletionDateTime() {
288         return completionDateTime;
289     }
290
291     public void setCompletionDateTime(Date completionDateTime) {
292         this.completionDateTime = completionDateTime;
293     }
294
295
296     /**
297      * @return expectedCompletionDate
298      **/
299     @JsonProperty("expectedCompletionDate")
300     @ApiModelProperty(value = "")
301     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
302     public Date getExpectedCompletionDate() {
303         return expectedCompletionDate;
304     }
305
306     public void setExpectedCompletionDate(Date expectedCompletionDate) {
307         this.expectedCompletionDate = expectedCompletionDate;
308     }
309
310     public ServiceOrder requestedStartDate(Date requestedStartDate) {
311         this.requestedStartDate = requestedStartDate;
312         return this;
313     }
314
315     /**
316      * Order start date wished by the requestor
317      *
318      * @return requestedStartDate
319      **/
320     @JsonProperty("requestedStartDate")
321     @ApiModelProperty(value = "Order start date wished by the requestor")
322     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
323     public Date getRequestedStartDate() {
324         return requestedStartDate;
325     }
326
327     public void setRequestedStartDate(Date requestedStartDate) {
328         this.requestedStartDate = requestedStartDate;
329     }
330
331     public ServiceOrder requestedCompletionDate(Date requestedCompletionDate) {
332         this.requestedCompletionDate = requestedCompletionDate;
333         return this;
334     }
335
336     /**
337      * Requested delivery date from the requestor perspective
338      *
339      * @return requestedCompletionDate
340      **/
341     @JsonProperty("requestedCompletionDate")
342     @ApiModelProperty(value = "Requested delivery date from the requestor perspective")
343     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
344     public Date getRequestedCompletionDate() {
345         return requestedCompletionDate;
346     }
347
348     public void setRequestedCompletionDate(Date requestedCompletionDate) {
349         this.requestedCompletionDate = requestedCompletionDate;
350     }
351
352     public ServiceOrder startDate(Date startDate) {
353         this.startDate = startDate;
354         return this;
355     }
356
357     /**
358      * Date when the order was started for processing
359      *
360      * @return startDate
361      **/
362     @JsonProperty("startDate")
363     @ApiModelProperty(value = "Date when the order was started for processing")
364     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
365     public Date getStartDate() {
366         return startDate;
367     }
368
369     public void setStartDate(Date startDate) {
370         this.startDate = startDate;
371     }
372
373     public ServiceOrder baseType(String baseType) {
374         this.baseType = baseType;
375         return this;
376     }
377
378     /**
379      * @return baseType
380      **/
381     @JsonProperty("@baseType")
382     @ApiModelProperty(value = "")
383     public String getBaseType() {
384         return baseType;
385     }
386
387     public void setBaseType(String baseType) {
388         this.baseType = baseType;
389     }
390
391     public ServiceOrder type(String type) {
392         this.type = type;
393         return this;
394     }
395
396     /**
397      * @return type
398      **/
399     @JsonProperty("@type")
400     @ApiModelProperty(value = "")
401     public String getType() {
402         return type;
403     }
404
405     public void setType(String type) {
406         this.type = type;
407     }
408
409     public ServiceOrder schemaLocation(String schemaLocation) {
410         this.schemaLocation = schemaLocation;
411         return this;
412     }
413
414     /**
415      * @return schemaLocation
416      **/
417     @JsonProperty("@schemaLocation")
418     @ApiModelProperty(value = "")
419     public String getSchemaLocation() {
420         return schemaLocation;
421     }
422
423     public void setSchemaLocation(String schemaLocation) {
424         this.schemaLocation = schemaLocation;
425     }
426
427     public ServiceOrder relatedParty(List<RelatedParty> relatedParty) {
428         this.relatedParty = relatedParty;
429         return this;
430     }
431
432     public ServiceOrder addRelatedPartyItem(RelatedParty relatedPartyItem) {
433         if (this.relatedParty == null) {
434             this.relatedParty = new ArrayList<RelatedParty>();
435         }
436         this.relatedParty.add(relatedPartyItem);
437         return this;
438     }
439
440     /**
441      * A list of related parties which are involved in this order and the role they are playing.
442      *
443      * @return relatedParty
444      **/
445     @JsonProperty("relatedParty")
446     @ApiModelProperty(
447             value = "A list of related parties which are involved in this order and the role they are playing.")
448     public List<RelatedParty> getRelatedParty() {
449         return relatedParty;
450     }
451
452     public void setRelatedParty(List<RelatedParty> relatedParty) {
453         this.relatedParty = relatedParty;
454     }
455
456     public ServiceOrder orderRelationship(List<OrderRelationship> orderRelationship) {
457         this.orderRelationship = orderRelationship;
458         return this;
459     }
460
461     public ServiceOrder addOrderRelationshipItem(OrderRelationship orderRelationshipItem) {
462         if (this.orderRelationship == null) {
463             this.orderRelationship = new ArrayList<OrderRelationship>();
464         }
465         this.orderRelationship.add(orderRelationshipItem);
466         return this;
467     }
468
469     /**
470      * A list of related order references .Linked order to the one containing this attribute
471      *
472      * @return orderRelationship
473      **/
474     @JsonProperty("orderRelationship")
475     @ApiModelProperty(value = "A list of related order references .Linked order to the one containing this attribute")
476     public List<OrderRelationship> getOrderRelationship() {
477         return orderRelationship;
478     }
479
480     public void setOrderRelationship(List<OrderRelationship> orderRelationship) {
481         this.orderRelationship = orderRelationship;
482     }
483
484     public ServiceOrder orderItem(List<ServiceOrderItem> orderItem) {
485         this.orderItem = orderItem;
486         return this;
487     }
488
489     public ServiceOrder addOrderItemItem(ServiceOrderItem orderItemItem) {
490         if (this.orderItem == null) {
491             this.orderItem = new ArrayList<ServiceOrderItem>();
492         }
493         this.orderItem.add(orderItemItem);
494         return this;
495     }
496
497     /**
498      * A list of order items that have to be processed.
499      *
500      * @return orderItem
501      **/
502     @JsonProperty("orderItem")
503     @ApiModelProperty(value = "A list of order items that have to be processed.")
504     @NotEmpty
505     public List<ServiceOrderItem> getOrderItem() {
506         return orderItem;
507     }
508
509     public void setOrderItem(List<ServiceOrderItem> orderItem) {
510         this.orderItem = orderItem;
511     }
512
513
514     @Override
515     public boolean equals(java.lang.Object o) {
516         if (this == o) {
517             return true;
518         }
519         if (o == null || getClass() != o.getClass()) {
520             return false;
521         }
522         ServiceOrder serviceOrder = (ServiceOrder) o;
523         return Objects.equals(this.id, serviceOrder.id) && Objects.equals(this.href, serviceOrder.href)
524                 && Objects.equals(this.externalId, serviceOrder.externalId)
525                 && Objects.equals(this.priority, serviceOrder.priority)
526                 && Objects.equals(this.description, serviceOrder.description)
527                 && Objects.equals(this.category, serviceOrder.category)
528                 && Objects.equals(this.state, serviceOrder.state)
529                 && Objects.equals(this.orderDate, serviceOrder.orderDate)
530                 && Objects.equals(this.completionDateTime, serviceOrder.completionDateTime)
531                 && Objects.equals(this.expectedCompletionDate, serviceOrder.expectedCompletionDate)
532                 && Objects.equals(this.requestedStartDate, serviceOrder.requestedStartDate)
533                 && Objects.equals(this.requestedCompletionDate, serviceOrder.requestedCompletionDate)
534                 && Objects.equals(this.startDate, serviceOrder.startDate)
535                 && Objects.equals(this.baseType, serviceOrder.baseType) && Objects.equals(this.type, serviceOrder.type)
536                 && Objects.equals(this.schemaLocation, serviceOrder.schemaLocation)
537                 && Objects.equals(this.relatedParty, serviceOrder.relatedParty)
538                 && Objects.equals(this.orderRelationship, serviceOrder.orderRelationship)
539                 && Objects.equals(this.orderItem, serviceOrder.orderItem);
540     }
541
542     @Override
543     public int hashCode() {
544         return Objects.hash(id, href, externalId, priority, description, category, state, orderDate, completionDateTime,
545                 expectedCompletionDate, requestedStartDate, requestedCompletionDate, startDate, baseType, type,
546                 schemaLocation, relatedParty, orderRelationship, orderItem);
547     }
548
549
550     @Override
551     public String toString() {
552         StringBuilder sb = new StringBuilder();
553         sb.append("class ServiceOrder {\n");
554
555         sb.append("    id: ").append(toIndentedString(id)).append("\n");
556         sb.append("    href: ").append(toIndentedString(href)).append("\n");
557         sb.append("    externalId: ").append(toIndentedString(externalId)).append("\n");
558         sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
559         sb.append("    description: ").append(toIndentedString(description)).append("\n");
560         sb.append("    category: ").append(toIndentedString(category)).append("\n");
561         sb.append("    state: ").append(toIndentedString(state)).append("\n");
562         sb.append("    orderDate: ").append(toIndentedString(orderDate)).append("\n");
563         sb.append("    completionDateTime: ").append(toIndentedString(completionDateTime)).append("\n");
564         sb.append("    expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n");
565         sb.append("    requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n");
566         sb.append("    requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n");
567         sb.append("    startDate: ").append(toIndentedString(startDate)).append("\n");
568         sb.append("    baseType: ").append(toIndentedString(baseType)).append("\n");
569         sb.append("    type: ").append(toIndentedString(type)).append("\n");
570         sb.append("    schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
571         sb.append("    relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
572         sb.append("    orderRelationship: ").append(toIndentedString(orderRelationship)).append("\n");
573         sb.append("    orderItem: ").append(toIndentedString(orderItem)).append("\n");
574         sb.append("}");
575         return sb.toString();
576     }
577
578     /**
579      * Convert the given object to string with each line indented by 4 spaces (except the first
580      * line).
581      */
582     private String toIndentedString(java.lang.Object o) {
583         if (o == null) {
584             return "null";
585         }
586         return o.toString().replace("\n", "\n    ");
587     }
588 }
589