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