Skip to content

Commit 871c126

Browse files
committed
fix: restore the old version of plugins resource API
Signed-off-by: Stiliyan Valkanov <stiliyan.valkanov@bearingpoint.com>
1 parent 81a9f67 commit 871c126

35 files changed

Lines changed: 4441 additions & 59 deletions

File tree

api/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,32 @@ SPDX-License-Identifier: Apache-2.0
4646
<version>7.12.0</version>
4747

4848
<executions>
49+
<execution>
50+
<id>generate-api</id>
51+
<goals>
52+
<goal>generate</goal>
53+
</goals>
54+
<phase>none</phase>
55+
56+
<configuration>
57+
<inputSpec>${project.basedir}/plugins-custom-resources.yaml</inputSpec>
58+
<generatorName>jaxrs-spec</generatorName>
59+
<output>${project.basedir}</output>
60+
<templateDirectory>${project.basedir}/src/main/resources/templates</templateDirectory>
61+
<generateSupportingFiles>false</generateSupportingFiles>
62+
63+
<configOptions>
64+
<sourceFolder>src/main/java</sourceFolder>
65+
<apiPackage>org.lfenergy.compas.scl.data.rest</apiPackage>
66+
<modelPackage>org.lfenergy.compas.scl.data.rest.dto</modelPackage>
67+
<interfaceOnly>true</interfaceOnly>
68+
<useTags>true</useTags>
69+
<useJakartaEe>true</useJakartaEe>
70+
<useSwaggerAnnotations>false</useSwaggerAnnotations>
71+
<hideGenerationTimestamp>true</hideGenerationTimestamp>
72+
</configOptions>
73+
</configuration>
74+
</execution>
4975
<execution>
5076
<id>generate-plugins-resources-api</id>
5177
<goals>
Lines changed: 330 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,330 @@
1+
// SPDX-FileCopyrightText: 2026 BearingPoint GmbH
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
package org.lfenergy.compas.scl.data.rest.api.plugins.resources;
5+
6+
import java.util.Date;
7+
import java.util.UUID;
8+
import jakarta.validation.constraints.*;
9+
10+
import java.util.Objects;
11+
import com.fasterxml.jackson.annotation.JsonProperty;
12+
import com.fasterxml.jackson.annotation.JsonCreator;
13+
import com.fasterxml.jackson.annotation.JsonValue;
14+
import com.fasterxml.jackson.annotation.JsonTypeName;
15+
16+
17+
18+
@JsonTypeName("DataEntry")
19+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.12.0")
20+
public class DataEntry {
21+
private UUID id;
22+
private String type;
23+
private String tenant;
24+
private String name;
25+
private String description;
26+
public enum ContentTypeEnum {
27+
28+
APPLICATION_JSON(String.valueOf("application/json")), APPLICATION_XML(String.valueOf("application/xml"));
29+
30+
31+
private String value;
32+
33+
ContentTypeEnum (String v) {
34+
value = v;
35+
}
36+
37+
public String value() {
38+
return value;
39+
}
40+
41+
@Override
42+
@JsonValue
43+
public String toString() {
44+
return String.valueOf(value);
45+
}
46+
47+
/**
48+
* Convert a String into String, as specified in the
49+
* <a href="https://download.oracle.com/otndocs/jcp/jaxrs-2_0-fr-eval-spec/index.html">See JAX RS 2.0 Specification, section 3.2, p. 12</a>
50+
*/
51+
public static ContentTypeEnum fromString(String s) {
52+
for (ContentTypeEnum b : ContentTypeEnum.values()) {
53+
// using Objects.toString() to be safe if value type non-object type
54+
// because types like 'int' etc. will be auto-boxed
55+
if (java.util.Objects.toString(b.value).equals(s)) {
56+
return b;
57+
}
58+
}
59+
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
60+
}
61+
62+
@JsonCreator
63+
public static ContentTypeEnum fromValue(String value) {
64+
for (ContentTypeEnum b : ContentTypeEnum.values()) {
65+
if (b.value.equals(value)) {
66+
return b;
67+
}
68+
}
69+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
70+
}
71+
}
72+
73+
private ContentTypeEnum contentType;
74+
private String version;
75+
private String dataCompatibilityVersion;
76+
private Date uploadedAt;
77+
78+
public DataEntry() {
79+
}
80+
81+
@JsonCreator
82+
public DataEntry(
83+
@JsonProperty(required = true, value = "id") UUID id,
84+
@JsonProperty(required = true, value = "type") String type,
85+
@JsonProperty(required = true, value = "tenant") String tenant,
86+
@JsonProperty(required = true, value = "name") String name,
87+
@JsonProperty(required = true, value = "contentType") ContentTypeEnum contentType,
88+
@JsonProperty(required = true, value = "version") String version,
89+
@JsonProperty(required = true, value = "dataCompatibilityVersion") String dataCompatibilityVersion,
90+
@JsonProperty(required = true, value = "uploadedAt") Date uploadedAt
91+
) {
92+
this.id = id;
93+
this.type = type;
94+
this.tenant = tenant;
95+
this.name = name;
96+
this.contentType = contentType;
97+
this.version = version;
98+
this.dataCompatibilityVersion = dataCompatibilityVersion;
99+
this.uploadedAt = uploadedAt;
100+
}
101+
102+
/**
103+
* Unique identifier for the data entry
104+
**/
105+
public DataEntry id(UUID id) {
106+
this.id = id;
107+
return this;
108+
}
109+
110+
111+
@JsonProperty(required = true, value = "id")
112+
@NotNull public UUID getId() {
113+
return id;
114+
}
115+
116+
@JsonProperty(required = true, value = "id")
117+
public void setId(UUID id) {
118+
this.id = id;
119+
}
120+
121+
/**
122+
* Type of the data
123+
**/
124+
public DataEntry type(String type) {
125+
this.type = type;
126+
return this;
127+
}
128+
129+
130+
@JsonProperty(required = true, value = "type")
131+
@NotNull public String getType() {
132+
return type;
133+
}
134+
135+
@JsonProperty(required = true, value = "type")
136+
public void setType(String type) {
137+
this.type = type;
138+
}
139+
140+
/**
141+
* Tenant identifier
142+
**/
143+
public DataEntry tenant(String tenant) {
144+
this.tenant = tenant;
145+
return this;
146+
}
147+
148+
149+
@JsonProperty(required = true, value = "tenant")
150+
@NotNull public String getTenant() {
151+
return tenant;
152+
}
153+
154+
@JsonProperty(required = true, value = "tenant")
155+
public void setTenant(String tenant) {
156+
this.tenant = tenant;
157+
}
158+
159+
/**
160+
* Name of the data file
161+
**/
162+
public DataEntry name(String name) {
163+
this.name = name;
164+
return this;
165+
}
166+
167+
168+
@JsonProperty(required = true, value = "name")
169+
@NotNull public String getName() {
170+
return name;
171+
}
172+
173+
@JsonProperty(required = true, value = "name")
174+
public void setName(String name) {
175+
this.name = name;
176+
}
177+
178+
/**
179+
* Optional description of the data file
180+
**/
181+
public DataEntry description(String description) {
182+
this.description = description;
183+
return this;
184+
}
185+
186+
187+
@JsonProperty("description")
188+
public String getDescription() {
189+
return description;
190+
}
191+
192+
@JsonProperty("description")
193+
public void setDescription(String description) {
194+
this.description = description;
195+
}
196+
197+
/**
198+
* Content type of the file
199+
**/
200+
public DataEntry contentType(ContentTypeEnum contentType) {
201+
this.contentType = contentType;
202+
return this;
203+
}
204+
205+
206+
@JsonProperty(required = true, value = "contentType")
207+
@NotNull public ContentTypeEnum getContentType() {
208+
return contentType;
209+
}
210+
211+
@JsonProperty(required = true, value = "contentType")
212+
public void setContentType(ContentTypeEnum contentType) {
213+
this.contentType = contentType;
214+
}
215+
216+
/**
217+
* Semantic version of the data file
218+
**/
219+
public DataEntry version(String version) {
220+
this.version = version;
221+
return this;
222+
}
223+
224+
225+
@JsonProperty(required = true, value = "version")
226+
@NotNull public String getVersion() {
227+
return version;
228+
}
229+
230+
@JsonProperty(required = true, value = "version")
231+
public void setVersion(String version) {
232+
this.version = version;
233+
}
234+
235+
/**
236+
* Data compatibility version
237+
**/
238+
public DataEntry dataCompatibilityVersion(String dataCompatibilityVersion) {
239+
this.dataCompatibilityVersion = dataCompatibilityVersion;
240+
return this;
241+
}
242+
243+
244+
@JsonProperty(required = true, value = "dataCompatibilityVersion")
245+
@NotNull public String getDataCompatibilityVersion() {
246+
return dataCompatibilityVersion;
247+
}
248+
249+
@JsonProperty(required = true, value = "dataCompatibilityVersion")
250+
public void setDataCompatibilityVersion(String dataCompatibilityVersion) {
251+
this.dataCompatibilityVersion = dataCompatibilityVersion;
252+
}
253+
254+
/**
255+
* Timestamp when the data was uploaded
256+
**/
257+
public DataEntry uploadedAt(Date uploadedAt) {
258+
this.uploadedAt = uploadedAt;
259+
return this;
260+
}
261+
262+
263+
@JsonProperty(required = true, value = "uploadedAt")
264+
@NotNull public Date getUploadedAt() {
265+
return uploadedAt;
266+
}
267+
268+
@JsonProperty(required = true, value = "uploadedAt")
269+
public void setUploadedAt(Date uploadedAt) {
270+
this.uploadedAt = uploadedAt;
271+
}
272+
273+
274+
@Override
275+
public boolean equals(Object o) {
276+
if (this == o) {
277+
return true;
278+
}
279+
if (o == null || getClass() != o.getClass()) {
280+
return false;
281+
}
282+
DataEntry dataEntry = (DataEntry) o;
283+
return Objects.equals(this.id, dataEntry.id) &&
284+
Objects.equals(this.type, dataEntry.type) &&
285+
Objects.equals(this.tenant, dataEntry.tenant) &&
286+
Objects.equals(this.name, dataEntry.name) &&
287+
Objects.equals(this.description, dataEntry.description) &&
288+
Objects.equals(this.contentType, dataEntry.contentType) &&
289+
Objects.equals(this.version, dataEntry.version) &&
290+
Objects.equals(this.dataCompatibilityVersion, dataEntry.dataCompatibilityVersion) &&
291+
Objects.equals(this.uploadedAt, dataEntry.uploadedAt);
292+
}
293+
294+
@Override
295+
public int hashCode() {
296+
return Objects.hash(id, type, tenant, name, description, contentType, version, dataCompatibilityVersion, uploadedAt);
297+
}
298+
299+
@Override
300+
public String toString() {
301+
StringBuilder sb = new StringBuilder();
302+
sb.append("class DataEntry {\n");
303+
304+
sb.append(" id: ").append(toIndentedString(id)).append("\n");
305+
sb.append(" type: ").append(toIndentedString(type)).append("\n");
306+
sb.append(" tenant: ").append(toIndentedString(tenant)).append("\n");
307+
sb.append(" name: ").append(toIndentedString(name)).append("\n");
308+
sb.append(" description: ").append(toIndentedString(description)).append("\n");
309+
sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
310+
sb.append(" version: ").append(toIndentedString(version)).append("\n");
311+
sb.append(" dataCompatibilityVersion: ").append(toIndentedString(dataCompatibilityVersion)).append("\n");
312+
sb.append(" uploadedAt: ").append(toIndentedString(uploadedAt)).append("\n");
313+
sb.append("}");
314+
return sb.toString();
315+
}
316+
317+
/**
318+
* Convert the given object to string with each line indented by 4 spaces
319+
* (except the first line).
320+
*/
321+
private String toIndentedString(Object o) {
322+
if (o == null) {
323+
return "null";
324+
}
325+
return o.toString().replace("\n", "\n ");
326+
}
327+
328+
329+
}
330+

0 commit comments

Comments
 (0)