Implement E2EService activation/deactivation for NetworkSlicing
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / Service.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 package org.onap.nbi.apis.serviceorder.model;
38
39 import com.fasterxml.jackson.annotation.JsonProperty;
40 import io.swagger.annotations.ApiModel;
41 import io.swagger.annotations.ApiModelProperty;
42 import javax.validation.Valid;
43 import javax.validation.constraints.NotNull;
44 import java.util.ArrayList;
45 import java.util.List;
46 import java.util.Objects;
47
48 /**
49  * Service attributes description (these are as per the Service ODE model as used in the Service
50  * Inventory specification)
51  */
52 @ApiModel(
53         description = "Service attributes description (these are as per the Service ODE model as used in the Service Inventory specification)")
54 @javax.annotation.Generated(
55         value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
56         date = "2018-02-19T14:00:30.767Z")
57 public class Service {
58     @JsonProperty("id")
59     private String id = null;
60     
61     @JsonProperty("serviceType")
62     private String servicetype = null;
63
64     @JsonProperty("href")
65     private String href = null;
66
67     @JsonProperty("name")
68     private String name = null;
69
70     @JsonProperty("serviceState")
71     private ServiceStateType serviceState = null;
72
73     @JsonProperty("@type")
74     private String type = null;
75
76     @JsonProperty("@schemaLocation")
77     private String schemaLocation = null;
78
79     @JsonProperty("serviceCharacteristic")
80     private List<ServiceCharacteristic> serviceCharacteristic = null;
81
82     @JsonProperty("serviceRelationship")
83     private List<ServiceRelationship> serviceRelationship = null;
84
85     @JsonProperty("relatedParty")
86     private List<RelatedParty> relatedParty = null;
87
88     @JsonProperty("serviceSpecification")
89     private ServiceSpecificationRef serviceSpecification = null;
90
91     public Service id(String id) {
92         this.id = id;
93         return this;
94     }
95
96     /**
97      * Identifier of a service instance
98      *
99      * @return id
100      **/
101     @JsonProperty("id")
102     @ApiModelProperty(value = "Identifier of a service instance")
103     public String getId() {
104         return id;
105     }
106
107     public void setId(String id) {
108         this.id = id;
109     }
110     
111     @JsonProperty("serviceType")
112     @ApiModelProperty(value = "Business type of the service") 
113     public String getServicetype() {
114                 return servicetype;
115         }
116
117         public void setServicetype(String servicetype) {
118                 this.servicetype = servicetype;
119         }
120
121     public Service href(String href) {
122         this.href = href;
123         return this;
124     }
125
126     /**
127      * Reference to the owned Service (useful for delete or modify command)
128      *
129      * @return href
130      **/
131     @JsonProperty("href")
132     @ApiModelProperty(value = "Reference to the owned Service (useful for delete or modify command)")
133     public String getHref() {
134         return href;
135     }
136
137     public void setHref(String href) {
138         this.href = href;
139     }
140
141     public Service name(String name) {
142         this.name = name;
143         return this;
144     }
145
146     /**
147      * Name of the service
148      *
149      * @return name
150      **/
151     @JsonProperty("name")
152     @ApiModelProperty(value = "Name of the service")
153     public String getName() {
154         return name;
155     }
156
157     public void setName(String name) {
158         this.name = name;
159     }
160
161     public Service serviceState(ServiceStateType serviceState) {
162         this.serviceState = serviceState;
163         return this;
164     }
165
166     /**
167      * The lifecycle state of the service
168      *
169      * @return serviceState
170      **/
171     @JsonProperty("serviceState")
172     @ApiModelProperty(value = "The lifecycle state of the service")
173     public ServiceStateType getServiceState() {
174         return serviceState;
175     }
176
177     public void setServiceState(ServiceStateType serviceState) {
178         this.serviceState = serviceState;
179     }
180
181     public Service type(String type) {
182         this.type = type;
183         return this;
184     }
185
186     /**
187      * @return type
188      **/
189     @JsonProperty("@type")
190     @ApiModelProperty(value = "")
191     public String getType() {
192         return type;
193     }
194
195     public void setType(String type) {
196         this.type = type;
197     }
198
199     public Service schemaLocation(String schemaLocation) {
200         this.schemaLocation = schemaLocation;
201         return this;
202     }
203
204     /**
205      * @return schemaLocation
206      **/
207     @JsonProperty("@schemaLocation")
208     @ApiModelProperty(value = "")
209     public String getSchemaLocation() {
210         return schemaLocation;
211     }
212
213     public void setSchemaLocation(String schemaLocation) {
214         this.schemaLocation = schemaLocation;
215     }
216
217     public Service serviceCharacteristic(List<ServiceCharacteristic> serviceCharacteristic) {
218         this.serviceCharacteristic = serviceCharacteristic;
219         return this;
220     }
221
222     public Service addServiceCharacteristicItem(ServiceCharacteristic serviceCharacteristicItem) {
223         if (this.serviceCharacteristic == null) {
224             this.serviceCharacteristic = new ArrayList<ServiceCharacteristic>();
225         }
226         this.serviceCharacteristic.add(serviceCharacteristicItem);
227         return this;
228     }
229
230     /**
231      * A list of service characteristics .A name/value pair list used to store instance specific
232      * values of attributes. The behavior is equivalent to a MAP data structure where only one entry
233      * for any given value of \&quot;name\&quot; can exist
234      *
235      * @return serviceCharacteristic
236      **/
237     @JsonProperty("serviceCharacteristic")
238     @ApiModelProperty(
239             value = "A list of service characteristics .A name/value pair list used to store instance specific values of attributes. The behavior is equivalent to a MAP data structure where only one entry for any given value of \"name\" can exist")
240     @Valid
241     public List<ServiceCharacteristic> getServiceCharacteristic() {
242         return serviceCharacteristic;
243     }
244
245     public void setServiceCharacteristic(List<ServiceCharacteristic> serviceCharacteristic) {
246         this.serviceCharacteristic = serviceCharacteristic;
247     }
248
249     public Service serviceRelationship(List<ServiceRelationship> serviceRelationship) {
250         this.serviceRelationship = serviceRelationship;
251         return this;
252     }
253
254     public Service addServiceRelationshipItem(ServiceRelationship serviceRelationshipItem) {
255         if (this.serviceRelationship == null) {
256             this.serviceRelationship = new ArrayList<ServiceRelationship>();
257         }
258         this.serviceRelationship.add(serviceRelationshipItem);
259         return this;
260     }
261
262     /**
263      * A list or service relationships (ServiceRelationship[*]). Linked Services to the one
264      * instantiate, it can be : “reliesOn” if the Service needs another already owned Service to
265      * rely on (e.g. an option on an already owned mobile access Service) or “targets” or
266      * “isTargeted” (depending on the way of expressing the link) for any other kind of links that
267      * may be useful
268      *
269      * @return serviceRelationship
270      **/
271     @JsonProperty("serviceRelationship")
272     @ApiModelProperty(
273             value = "A list or service relationships (ServiceRelationship[*]). Linked Services to the one instantiate, it can be : “reliesOn” if the Service needs another already owned Service to rely on (e.g. an option on an already owned mobile access Service) or “targets” or “isTargeted” (depending on the way of expressing the link) for any other kind of links that may be useful")
274     @Valid
275     public List<ServiceRelationship> getServiceRelationship() {
276         return serviceRelationship;
277     }
278
279     public void setServiceRelationship(List<ServiceRelationship> serviceRelationship) {
280         this.serviceRelationship = serviceRelationship;
281     }
282
283     public Service relatedParty(List<RelatedParty> relatedParty) {
284         this.relatedParty = relatedParty;
285         return this;
286     }
287
288     public Service addRelatedPartyItem(RelatedParty relatedPartyItem) {
289         if (this.relatedParty == null) {
290             this.relatedParty = new ArrayList<RelatedParty>();
291         }
292         this.relatedParty.add(relatedPartyItem);
293         return this;
294     }
295
296     /**
297      * A list of related party parties linked at the Service level (it may be a User for example)
298      *
299      * @return relatedParty
300      **/
301     @JsonProperty("relatedParty")
302     @ApiModelProperty(
303             value = "A list of related party parties linked at the Service level (it may be a User for example)")
304     @Valid
305     public List<RelatedParty> getRelatedParty() {
306         return relatedParty;
307     }
308
309     public void setRelatedParty(List<RelatedParty> relatedParty) {
310         this.relatedParty = relatedParty;
311     }
312
313     public Service serviceSpecification(ServiceSpecificationRef serviceSpecification) {
314         this.serviceSpecification = serviceSpecification;
315         return this;
316     }
317
318     /**
319      * @return serviceSpecification
320      **/
321     @JsonProperty("serviceSpecification")
322     @ApiModelProperty(value = "")
323     @NotNull(message = "ServiceSpecification cannot be null")
324     @Valid
325     public ServiceSpecificationRef getServiceSpecification() {
326         return serviceSpecification;
327     }
328
329     public void setServiceSpecification(ServiceSpecificationRef serviceSpecification) {
330         this.serviceSpecification = serviceSpecification;
331     }
332
333     @Override
334     public boolean equals(java.lang.Object o) {
335         if (this == o) {
336             return true;
337         }
338         if (o == null || getClass() != o.getClass()) {
339             return false;
340         }
341         Service service = (Service) o;
342         return Objects.equals(this.id, service.id) && Objects.equals(this.href, service.href)
343                 && Objects.equals(this.name, service.name) && Objects.equals(this.serviceState, service.serviceState)
344                 && Objects.equals(this.type, service.type)
345                 && Objects.equals(this.schemaLocation, service.schemaLocation)
346                 && Objects.equals(this.serviceCharacteristic, service.serviceCharacteristic)
347                 && Objects.equals(this.serviceRelationship, service.serviceRelationship)
348                 && Objects.equals(this.relatedParty, service.relatedParty)
349                 && Objects.equals(this.serviceSpecification, service.serviceSpecification);
350     }
351
352     @Override
353     public int hashCode() {
354         return Objects.hash(id, href, name, serviceState, type, schemaLocation, serviceCharacteristic,
355                 serviceRelationship, relatedParty, serviceSpecification);
356     }
357
358     @Override
359     public String toString() {
360         StringBuilder sb = new StringBuilder();
361         sb.append("class Service {\n");
362
363         sb.append("    id: ").append(toIndentedString(id)).append("\n");
364         sb.append("    href: ").append(toIndentedString(href)).append("\n");
365         sb.append("    name: ").append(toIndentedString(name)).append("\n");
366         sb.append("    serviceState: ").append(toIndentedString(serviceState)).append("\n");
367         sb.append("    type: ").append(toIndentedString(type)).append("\n");
368         sb.append("    schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
369         sb.append("    serviceCharacteristic: ").append(toIndentedString(serviceCharacteristic)).append("\n");
370         sb.append("    serviceRelationship: ").append(toIndentedString(serviceRelationship)).append("\n");
371         sb.append("    relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
372         sb.append("    serviceSpecification: ").append(toIndentedString(serviceSpecification)).append("\n");
373         sb.append("}");
374         return sb.toString();
375     }
376
377     /**
378      * Convert the given object to string with each line indented by 4 spaces (except the first
379      * line).
380      */
381     private String toIndentedString(java.lang.Object o) {
382         if (o == null) {
383             return "null";
384         }
385         return o.toString().replace("\n", "\n    ");
386     }
387 }