Enrichment cordinator service, added job validation
[nonrtric.git] / enrichment-coordinator-service / src / main / java / org / oransc / enrichment / clients / ProducerJobInfo.java
1 /*-
2  * ========================LICENSE_START=================================
3  * ONAP : ccsdk oran
4  * ======================================================================
5  * Copyright (C) 2020 Nordix Foundation. 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.oransc.enrichment.clients;
22
23 import com.fasterxml.jackson.annotation.JsonProperty;
24 import com.google.gson.annotations.SerializedName;
25
26 import io.swagger.annotations.ApiModel;
27 import io.swagger.annotations.ApiModelProperty;
28
29 import org.immutables.gson.Gson;
30 import org.oransc.enrichment.repository.EiJob;
31 import org.oransc.enrichment.repository.EiType;
32
33 @Gson.TypeAdapters
34 @ApiModel(
35     value = "producer_ei_job_request",
36     description = "The body of the EI producer callbacks for EI job creation and deletion")
37 public class ProducerJobInfo {
38
39     @ApiModelProperty(value = "Idenitity of the EI job", required = true)
40     @SerializedName("ei_job_identity")
41     @JsonProperty("ei_job_identity")
42     public String id;
43
44     @ApiModelProperty(value = "Type idenitity for the job")
45     @SerializedName("ei_type_identity")
46     @JsonProperty("ei_type_identity")
47     public String typeId;
48
49     @ApiModelProperty(value = "Json for the job data")
50     @SerializedName("ei_job_data")
51     @JsonProperty("ei_job_data")
52     public Object jobData;
53
54     public ProducerJobInfo(Object jobData, String id, String typeId) {
55         this.id = id;
56         this.jobData = jobData;
57         this.typeId = typeId;
58     }
59
60     public ProducerJobInfo(Object jobData, EiJob job, EiType type) {
61         this(jobData, job.id(), type.getId());
62     }
63
64     public ProducerJobInfo() {
65     }
66
67 }