4f91d640bd3c20fd534c9bce20294fb406c00674
[nonrtric.git] / enrichment-coordinator-service / src / main / java / org / oransc / enrichment / controllers / r1consumer / ConsumerJobInfo.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.r1consumer;
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
30 @Gson.TypeAdapters
31 @Schema(name = "consumer_job", description = "Information for an Enrichment Information Job")
32 public class ConsumerJobInfo {
33
34     @Schema(
35         name = "info_type_id",
36         description = "Information type Idenitifier of the subscription job",
37         required = true)
38     @SerializedName("info_type_id")
39     @JsonProperty(value = "info_type_id", required = true)
40     public String infoTypeId = "";
41
42     @Schema(name = "job_owner", description = "Identity of the owner of the job", required = true)
43     @SerializedName("job_owner")
44     @JsonProperty(value = "job_owner", required = true)
45     public String owner = "";
46
47     @Schema(name = "job_definition", description = "Information type specific job data", required = true)
48     @SerializedName("job_definition")
49     @JsonProperty(value = "job_definition", required = true)
50     public Object jobDefinition;
51
52     @Schema(name = "job_result_uri", description = "The target URI of the subscribed information", required = true)
53     @SerializedName("job_result_uri")
54     @JsonProperty(value = "job_result_uri", required = true)
55     public String jobResultUri = "";
56
57     @Schema(
58         name = "status_notification_uri",
59         description = "The target of Information subscription job status notifications",
60         required = false)
61     @SerializedName("status_notification_uri")
62     @JsonProperty(value = "status_notification_uri", required = false)
63     public String statusNotificationUri = "";
64
65     public ConsumerJobInfo() {
66     }
67
68     public ConsumerJobInfo(String infoTypeId, Object jobData, String owner, String targetUri,
69         String statusNotificationUri) {
70         this.infoTypeId = infoTypeId;
71         this.jobDefinition = jobData;
72         this.owner = owner;
73         this.jobResultUri = targetUri;
74         this.statusNotificationUri = statusNotificationUri;
75     }
76 }