Merge "Kafka now works in kube for calls outside its namespace"
[nonrtric.git] / enrichment-coordinator-service / src / main / java / org / oransc / enrichment / controllers / r1producer / ProducerJobInfo.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2020 Nordix Foundation
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.controllers.r1producer;
22
23 import com.fasterxml.jackson.annotation.JsonProperty;
24 import com.google.gson.annotations.SerializedName;
25
26 import io.swagger.v3.oas.annotations.media.Schema;
27
28 import org.immutables.gson.Gson;
29 import org.oransc.enrichment.repository.InfoJob;
30
31 @Gson.TypeAdapters
32 @Schema(
33     name = "producer_info_job_request",
34     description = "The body of the Information Producer callbacks for Information Job creation and deletion")
35 public class ProducerJobInfo {
36
37     @Schema(name = "info_job_identity", description = "Identity of the Information Job", required = true)
38     @SerializedName("info_job_identity")
39     @JsonProperty("info_job_identity")
40     public String id = "";
41
42     @Schema(name = "info_type_identity", description = "Type identity for the job")
43     @SerializedName("info_type_identity")
44     @JsonProperty("info_type_identity")
45     public String typeId = "";
46
47     @Schema(name = "info_job_data", description = "Json for the job data")
48     @SerializedName("info_job_data")
49     @JsonProperty("info_job_data")
50     public Object jobData;
51
52     @Schema(name = "target_uri", description = "URI for the target of the produced Information")
53     @SerializedName("target_uri")
54     @JsonProperty("target_uri")
55     public String targetUri = "";
56
57     @Schema(name = "owner", description = "The owner of the job")
58     @SerializedName("owner")
59     @JsonProperty("owner")
60     public String owner = "";
61
62     @Schema(name = "last_updated", description = "The time when the job was last updated or created (ISO-8601)")
63     @SerializedName("last_updated")
64     @JsonProperty("last_updated")
65     public String lastUpdated = "";
66
67     public ProducerJobInfo(Object jobData, String id, String typeId, String targetUri, String owner,
68         String lastUpdated) {
69         this.id = id;
70         this.jobData = jobData;
71         this.typeId = typeId;
72         this.targetUri = targetUri;
73         this.owner = owner;
74         this.lastUpdated = lastUpdated;
75     }
76
77     public ProducerJobInfo(InfoJob job) {
78         this(job.getJobData(), job.getId(), job.getTypeId(), job.getTargetUrl(), job.getOwner(), job.getLastUpdated());
79     }
80
81     public ProducerJobInfo() {
82     }
83
84 }