Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ public static void main(String[] args) throws IOException {
.destination(
new AddVPCStaticRoutePayloadDestination(
new DestinationCIDRv4()
.type("cidrv4")
.type(DestinationCIDRv4.TypeEnum.CIDRV4)
.value("0.0.0.0/0")))
.nexthop(
new AddVPCStaticRoutePayloadNexthop(
new NexthopInternet().type("internet"))));
new NexthopInternet().type(NexthopInternet.TypeEnum.INTERNET))));
System.out.println("static route created: " + r.staticRoute.getId());

// create a network range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,43 @@ public static GsonBuilder createGson() {
getDiscriminatorValue(readElement, "type"));
}
})
.registerTypeSelector(
cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute.class,
new TypeSelector<
cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute>() {
@Override
public Class<
? extends
cloud.stackit.sdk.iaas.v2alpha1api.model
.AnyRoute>
getClassForElement(JsonElement readElement) {
Map<String, Class> classByDiscriminatorValue =
new HashMap<String, Class>();
classByDiscriminatorValue.put(
"dynamic",
cloud.stackit.sdk.iaas.v2alpha1api.model
.AnyRouteDynamic.class);
classByDiscriminatorValue.put(
"service",
cloud.stackit.sdk.iaas.v2alpha1api.model
.AnyRouteService.class);
classByDiscriminatorValue.put(
"static",
cloud.stackit.sdk.iaas.v2alpha1api.model
.AnyRouteStatic.class);
classByDiscriminatorValue.put(
"system",
cloud.stackit.sdk.iaas.v2alpha1api.model
.AnyRouteSystem.class);
classByDiscriminatorValue.put(
"AnyRoute",
cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute
.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
getDiscriminatorValue(readElement, "type"));
}
})
.registerTypeSelector(
cloud.stackit.sdk.iaas.v2alpha1api.model
.CreateVPCNetworkRangePayload.class,
Expand Down Expand Up @@ -337,6 +374,31 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCStaticRoutePayloadNexthop
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AllRouteListResponse
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteDynamic
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteService
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSource
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSourceId
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteStatic
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSystem
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.BaseRoute.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv4
.CustomTypeAdapterFactory());
Expand Down Expand Up @@ -407,6 +469,14 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateVPCPayload
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixEntries
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixList.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixListListResponse
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPC
.CustomTypeAdapterFactory());
Expand All @@ -416,6 +486,9 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPCList
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.RetypeVolumePayload
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.iaas.v2alpha1api.model.Route.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
Expand Down
Loading
Loading