Skip to content

Commit a2937d3

Browse files
committed
add override fixes
1 parent de5668e commit a2937d3

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateSnapshotsResult.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
242242
"Expected the field `kind` to be a primitive type in the JSON string but got `%s`",
243243
jsonObj.get("kind").toString()));
244244
}
245+
// OVERRIDE START: this if block fixes oneOf issues
246+
if (!"CreateSnapshotsResult".equals(jsonObj.get("kind").getAsString())) {
247+
throw new IllegalArgumentException(
248+
String.format(
249+
java.util.Locale.ROOT,
250+
"Expected the field `kind` to have value `CreateSnapshotsResult` but got `%s`",
251+
jsonObj.get("kind").toString()));
252+
}
253+
// OVERRIDE END: this if block fixes oneOf issues
245254
}
246255

247256
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeIDsResult.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
229229
"Expected the field `kind` to be a primitive type in the JSON string but got `%s`",
230230
jsonObj.get("kind").toString()));
231231
}
232+
// OVERRIDE START: this if block fixes oneOf issues
233+
if (!"GetVolumeIDsResult".equals(jsonObj.get("kind").getAsString())) {
234+
throw new IllegalArgumentException(
235+
String.format(
236+
java.util.Locale.ROOT,
237+
"Expected the field `kind` to have value `GetVolumeIDsResult` but got `%s`",
238+
jsonObj.get("kind").toString()));
239+
}
240+
// OVERRIDE END: this if block fixes oneOf issues
232241
// ensure the optional json data is an array if present
233242
if (jsonObj.get("volumeIDs") != null
234243
&& !jsonObj.get("volumeIDs").isJsonNull()

services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyCount.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
276276
"Expected the field `kind` to be a primitive type in the JSON string but got `%s`",
277277
jsonObj.get("kind").toString()));
278278
}
279+
// OVERRIDE START: this if block fixes oneOf issues
280+
if (!"count".equals(jsonObj.get("kind").getAsString())) {
281+
throw new IllegalArgumentException(
282+
String.format(
283+
java.util.Locale.ROOT,
284+
"Expected the field `kind` to have value `count` but got `%s`",
285+
jsonObj.get("kind").toString()));
286+
}
287+
// OVERRIDE END: this if block fixes oneOf issues
279288
// validate the required field `kind`
280289
KindEnum.validateJsonElement(jsonObj.get("kind"));
281290
}

services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyIndefinitely.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
250250
"Expected the field `kind` to be a primitive type in the JSON string but got `%s`",
251251
jsonObj.get("kind").toString()));
252252
}
253+
// OVERRIDE START: this if block fixes oneOf issues
254+
if (!"indefinitely".equals(jsonObj.get("kind").getAsString())) {
255+
throw new IllegalArgumentException(
256+
String.format(
257+
java.util.Locale.ROOT,
258+
"Expected the field `kind` to have value `indefinitely` but got `%s`",
259+
jsonObj.get("kind").toString()));
260+
}
261+
// OVERRIDE END: this if block fixes oneOf issues
253262
// validate the required field `kind`
254263
KindEnum.validateJsonElement(jsonObj.get("kind"));
255264
}

0 commit comments

Comments
 (0)