diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv4.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv4.java index cb5b51fe..fa4abc01 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv4.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv4.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv4 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV4("cidrv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class DestinationCIDRv4 { public DestinationCIDRv4() { } - public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv6.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv6.java index a9917a17..63546cc0 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv6.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv6.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv6 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV6("cidrv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class DestinationCIDRv6 { public DestinationCIDRv6() { } - public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopBlackhole.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopBlackhole.java index 691d6173..65156814 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopBlackhole.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopBlackhole.java @@ -50,15 +50,67 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopBlackhole { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BLACKHOLE("blackhole"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopBlackhole() { } - public NexthopBlackhole type(@javax.annotation.Nonnull String type) { + public NexthopBlackhole type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -68,11 +120,11 @@ public NexthopBlackhole type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -206,6 +258,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv4.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv4.java index 6d6e829e..f181eda7 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv4.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv4.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv4 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV4("ipv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class NexthopIPv4 { public NexthopIPv4() { } - public NexthopIPv4 type(@javax.annotation.Nonnull String type) { + public NexthopIPv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public NexthopIPv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv6.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv6.java index c04ebc8b..04ee4b94 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv6.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv6.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv6 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV6("ipv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class NexthopIPv6 { public NexthopIPv6() { } - public NexthopIPv6 type(@javax.annotation.Nonnull String type) { + public NexthopIPv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public NexthopIPv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopInternet.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopInternet.java index f961e7bb..b587a317 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopInternet.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_nexthopInternet.java @@ -50,15 +50,67 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopInternet { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INTERNET("internet"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopInternet() { } - public NexthopInternet type(@javax.annotation.Nonnull String type) { + public NexthopInternet type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -68,11 +120,11 @@ public NexthopInternet type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -206,6 +258,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv4.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv4.java index 29592667..af25e3cb 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv4.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv4.java @@ -227,7 +227,7 @@ public VPCNetworkRangeIPv4 labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May contain an optional domain prefix separated by a slash (`/`). - Domain prefix must be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 and 63 characters. - Must begin and end with an alphanumerical character (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics in between. - Keys starting with the prefix `stackit-` or having a domain prefix of `stackit.cloud` (including its subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value constraints: - Must be less than or equal to 63 characters long (can be empty). - If not empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are excluded from this count. Providing a `null` value for a key will remove that key. * @return labels */ @javax.annotation.Nullable diff --git a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv6.java b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv6.java index 457361f6..8e140c43 100644 --- a/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv6.java +++ b/scripts/generators/overrides/java/iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv6.java @@ -227,7 +227,7 @@ public VPCNetworkRangeIPv6 labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May contain an optional domain prefix separated by a slash (`/`). - Domain prefix must be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 and 63 characters. - Must begin and end with an alphanumerical character (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics in between. - Keys starting with the prefix `stackit-` or having a domain prefix of `stackit.cloud` (including its subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value constraints: - Must be less than or equal to 63 characters long (can be empty). - If not empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are excluded from this count. Providing a `null` value for a key will remove that key. * @return labels */ @javax.annotation.Nullable diff --git a/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv4.java b/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv4.java index 3c3280fc..ffc4d863 100644 --- a/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv4.java +++ b/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv4.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv4 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV4("cidrv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class DestinationCIDRv4 { public DestinationCIDRv4() { } - public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv6.java b/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv6.java index 29d2dd40..df23c1d7 100644 --- a/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv6.java +++ b/scripts/generators/overrides/java/iaas/v2api/DestinationCIDRv6.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv6 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV6("cidrv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class DestinationCIDRv6 { public DestinationCIDRv6() { } - public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2api/NexthopBlackhole.java b/scripts/generators/overrides/java/iaas/v2api/NexthopBlackhole.java index b6435b22..a1b56a4f 100644 --- a/scripts/generators/overrides/java/iaas/v2api/NexthopBlackhole.java +++ b/scripts/generators/overrides/java/iaas/v2api/NexthopBlackhole.java @@ -50,15 +50,67 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopBlackhole { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BLACKHOLE("blackhole"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopBlackhole() { } - public NexthopBlackhole type(@javax.annotation.Nonnull String type) { + public NexthopBlackhole type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -68,11 +120,11 @@ public NexthopBlackhole type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -206,6 +258,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/scripts/generators/overrides/java/iaas/v2api/NexthopIPv4.java b/scripts/generators/overrides/java/iaas/v2api/NexthopIPv4.java index b453603c..201cbb2c 100644 --- a/scripts/generators/overrides/java/iaas/v2api/NexthopIPv4.java +++ b/scripts/generators/overrides/java/iaas/v2api/NexthopIPv4.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv4 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV4("ipv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class NexthopIPv4 { public NexthopIPv4() { } - public NexthopIPv4 type(@javax.annotation.Nonnull String type) { + public NexthopIPv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public NexthopIPv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2api/NexthopIPv6.java b/scripts/generators/overrides/java/iaas/v2api/NexthopIPv6.java index 731217ac..65a7c298 100644 --- a/scripts/generators/overrides/java/iaas/v2api/NexthopIPv6.java +++ b/scripts/generators/overrides/java/iaas/v2api/NexthopIPv6.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv6 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV6("ipv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class NexthopIPv6 { public NexthopIPv6() { } - public NexthopIPv6 type(@javax.annotation.Nonnull String type) { + public NexthopIPv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public NexthopIPv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2api/NexthopInternet.java b/scripts/generators/overrides/java/iaas/v2api/NexthopInternet.java index 2d07bee8..0ce7a164 100644 --- a/scripts/generators/overrides/java/iaas/v2api/NexthopInternet.java +++ b/scripts/generators/overrides/java/iaas/v2api/NexthopInternet.java @@ -50,15 +50,67 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopInternet { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INTERNET("internet"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopInternet() { } - public NexthopInternet type(@javax.annotation.Nonnull String type) { + public NexthopInternet type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -68,11 +120,11 @@ public NexthopInternet type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -206,6 +258,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv4.java b/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv4.java index 2113bcd6..641a4757 100644 --- a/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv4.java +++ b/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv4.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv4 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV4("cidrv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class DestinationCIDRv4 { public DestinationCIDRv4() { } - public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv6.java b/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv6.java index e6164e0f..b6df1284 100644 --- a/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv6.java +++ b/scripts/generators/overrides/java/iaas/v2beta1api/DestinationCIDRv6.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv6 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV6("cidrv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class DestinationCIDRv6 { public DestinationCIDRv6() { } - public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopBlackhole.java b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopBlackhole.java index 35b71dd2..1c5fa217 100644 --- a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopBlackhole.java +++ b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopBlackhole.java @@ -50,15 +50,67 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopBlackhole { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BLACKHOLE("blackhole"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopBlackhole() { } - public NexthopBlackhole type(@javax.annotation.Nonnull String type) { + public NexthopBlackhole type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -68,11 +120,11 @@ public NexthopBlackhole type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -206,6 +258,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv4.java b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv4.java index 2f698593..c6a063dd 100644 --- a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv4.java +++ b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv4.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv4 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV4("ipv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class NexthopIPv4 { public NexthopIPv4() { } - public NexthopIPv4 type(@javax.annotation.Nonnull String type) { + public NexthopIPv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public NexthopIPv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv6.java b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv6.java index 5a465b02..359e040c 100644 --- a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv6.java +++ b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopIPv6.java @@ -50,10 +50,62 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv6 { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV6("ipv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -63,7 +115,7 @@ public class NexthopIPv6 { public NexthopIPv6() { } - public NexthopIPv6 type(@javax.annotation.Nonnull String type) { + public NexthopIPv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -73,11 +125,11 @@ public NexthopIPv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -232,6 +284,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } diff --git a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopInternet.java b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopInternet.java index 332244b7..0d67c8c9 100644 --- a/scripts/generators/overrides/java/iaas/v2beta1api/NexthopInternet.java +++ b/scripts/generators/overrides/java/iaas/v2beta1api/NexthopInternet.java @@ -50,15 +50,67 @@ */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopInternet { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INTERNET("internet"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopInternet() { } - public NexthopInternet type(@javax.annotation.Nonnull String type) { + public NexthopInternet type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -68,11 +120,11 @@ public NexthopInternet type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -206,6 +258,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ) ); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/scripts/generators/overrides/java/overrides.properties b/scripts/generators/overrides/java/overrides.properties index 41d73354..e8451e28 100644 --- a/scripts/generators/overrides/java/overrides.properties +++ b/scripts/generators/overrides/java/overrides.properties @@ -16,80 +16,80 @@ automationV1BetaApiSnapshotRetentionPolicyIndefinitely.hash=f441b4be83c6368675c8 iaasV2AlphaApiRouteDestinationCIDRv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java iaasV2AlphaApiRouteDestinationCIDRv4.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv4.java -iaasV2AlphaApiRouteDestinationCIDRv4.hash=61c00060b5f19d949ef6f2c6cd82a13a +iaasV2AlphaApiRouteDestinationCIDRv4.hash=fa15bacf2804d8d04d06a146032897ee iaasV2AlphaApiRouteDestinationCIDRv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java iaasV2AlphaApiRouteDestinationCIDRv6.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_destinationCIDRv6.java -iaasV2AlphaApiRouteDestinationCIDRv6.hash=9e47a4ea974f9080093a6c9d2e615446 +iaasV2AlphaApiRouteDestinationCIDRv6.hash=c4df9184d4c8fc47dfef424b236d5c6c iaasV2AlphaApiNexthopIPv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java iaasV2AlphaApiNexthopIPv4.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv4.java -iaasV2AlphaApiNexthopIPv4.hash=2ea5d1b96781197503206c2f7c21e793 +iaasV2AlphaApiNexthopIPv4.hash=eb8789750e356abf359466d6c62dbe15 iaasV2AlphaApiNexthopIPv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java iaasV2AlphaApiNexthopIPv6.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_nexthopIPv6.java -iaasV2AlphaApiNexthopIPv6.hash=c81d6973112f919bc2a7d119edc30ac7 +iaasV2AlphaApiNexthopIPv6.hash=b649d826bc349e47ecc8c994f24d5385 iaasV2AlphaApiNexthopBlackhole.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java iaasV2AlphaApiNexthopBlackhole.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_nexthopBlackhole.java -iaasV2AlphaApiNexthopBlackhole.hash=ae20d347b1ac740c33ecc3d4ee42c9c9 +iaasV2AlphaApiNexthopBlackhole.hash=74d17cc84bbdfc99dfc19ff1fcff80b6 iaasV2AlphaApiNexthopInternet.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java iaasV2AlphaApiNexthopInternet.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_nexthopInternet.java -iaasV2AlphaApiNexthopInternet.hash=c56c0bab9c1772eacec3638d52af8aaa +iaasV2AlphaApiNexthopInternet.hash=422e4bb42cbded48e57f35a35a7e7a81 iaasV2AlphaApiVPCNetworkRangIPv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java iaasV2AlphaApiVPCNetworkRangIPv4.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv4.java -iaasV2AlphaApiVPCNetworkRangIPv4.hash=40609d6eae20476897b5e5be0de3d3fc +iaasV2AlphaApiVPCNetworkRangIPv4.hash=2c829e3991dc05bd4fde6383614a247a iaasV2AlphaApiVPCNetworkRangIPv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java iaasV2AlphaApiVPCNetworkRangIPv6.replacementPath=iaas/v2alpha1api/iaas_v2alpha_model_vpcNetworkRangeIPv6.java -iaasV2AlphaApiVPCNetworkRangIPv6.hash=d71c09fe5cb8b70c47888681f8d8d7a1 +iaasV2AlphaApiVPCNetworkRangIPv6.hash=b707bf15b842ad30cc998c08ed8076a6 -iaasV2RoutDestinationCIDRv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java -iaasV2RoutDestinationCIDRv4.replacementPath=iaas/v2api/DestinationCIDRv4.java -iaasV2RoutDestinationCIDRv4.hash=b79f08064422b8040d7f218c1f20957e +iaasV2RouteDestinationCIDRv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java +iaasV2RouteDestinationCIDRv4.replacementPath=iaas/v2api/DestinationCIDRv4.java +iaasV2RouteDestinationCIDRv4.hash=075f620c50a65067896860f73ae9d05d -iaasV2RoutDestinationCIDRv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java -iaasV2RoutDestinationCIDRv6.replacementPath=iaas/v2api/DestinationCIDRv6.java -iaasV2RoutDestinationCIDRv6.hash=8037f4ec45cbfde8445300d968ee7ed8 +iaasV2RouteDestinationCIDRv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java +iaasV2RouteDestinationCIDRv6.replacementPath=iaas/v2api/DestinationCIDRv6.java +iaasV2RouteDestinationCIDRv6.hash=a0ab059ef4a66067713c2099d2a2e68b -iaasV2RoutNexthopIPv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java -iaasV2RoutNexthopIPv4.replacementPath=iaas/v2api/NexthopIPv4.java -iaasV2RoutNexthopIPv4.hash=6fc66b4640d7542ea554c1a3b722867a +iaasV2RouteNexthopIPv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java +iaasV2RouteNexthopIPv4.replacementPath=iaas/v2api/NexthopIPv4.java +iaasV2RouteNexthopIPv4.hash=9fe4f34934b1ffc73aff39bb550a9d0a -iaasV2RoutNexthopIPv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java -iaasV2RoutNexthopIPv6.replacementPath=iaas/v2api/NexthopIPv6.java -iaasV2RoutNexthopIPv6.hash=c94522b47ce6bb9118a7f984c4e21b5e +iaasV2RouteNexthopIPv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java +iaasV2RouteNexthopIPv6.replacementPath=iaas/v2api/NexthopIPv6.java +iaasV2RouteNexthopIPv6.hash=573618660397c921aec05425f364866b -iaasV2RoutNexthopBlackhole.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java -iaasV2RoutNexthopBlackhole.replacementPath=iaas/v2api/NexthopBlackhole.java -iaasV2RoutNexthopBlackhole.hash=d96000d32e36ac4b4a4d6b593d13baf7 +iaasV2RouteNexthopBlackhole.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java +iaasV2RouteNexthopBlackhole.replacementPath=iaas/v2api/NexthopBlackhole.java +iaasV2RouteNexthopBlackhole.hash=68a7d98a6ff2f4b65766da1709d7166b -iaasV2RoutNexthopInternet.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java -iaasV2RoutNexthopInternet.replacementPath=iaas/v2api/NexthopInternet.java -iaasV2RoutNexthopInternet.hash=63be65c5560e58509820bde50251ef1b +iaasV2RouteNexthopInternet.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java +iaasV2RouteNexthopInternet.replacementPath=iaas/v2api/NexthopInternet.java +iaasV2RouteNexthopInternet.hash=9108c0884deabbff4094da27803ac7b4 -iaasV2betaRoutDestinationCIDRv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java -iaasV2betaRoutDestinationCIDRv4.replacementPath=iaas/v2beta1api/DestinationCIDRv4.java -iaasV2betaRoutDestinationCIDRv4.hash=aed7d0c5159bed1891cafa3695507638 +iaasV2betaRouteDestinationCIDRv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java +iaasV2betaRouteDestinationCIDRv4.replacementPath=iaas/v2beta1api/DestinationCIDRv4.java +iaasV2betaRouteDestinationCIDRv4.hash=821e2278c7604b4c3d2f6e72e8d9a365 -iaasV2betaRoutDestinationCIDRv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java -iaasV2betaRoutDestinationCIDRv6.replacementPath=iaas/v2beta1api/DestinationCIDRv6.java -iaasV2betaRoutDestinationCIDRv6.hash=93520dfa24f87b9c134e2cef7921234d +iaasV2betaRouteDestinationCIDRv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java +iaasV2betaRouteDestinationCIDRv6.replacementPath=iaas/v2beta1api/DestinationCIDRv6.java +iaasV2betaRouteDestinationCIDRv6.hash=a55c6d03e973013bd01557410fdee6ad -iaasV2betaRoutNexthopIPv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java -iaasV2betaRoutNexthopIPv4.replacementPath=iaas/v2beta1api/NexthopIPv4.java -iaasV2betaRoutNexthopIPv4.hash=95ff4343f14bf67c76939eb796a51b44 +iaasV2betaRouteNexthopIPv4.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java +iaasV2betaRouteNexthopIPv4.replacementPath=iaas/v2beta1api/NexthopIPv4.java +iaasV2betaRouteNexthopIPv4.hash=53995f795a7ec9288b6cc9c86642d4e2 -iaasV2betaRoutNexthopIPv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java -iaasV2betaRoutNexthopIPv6.replacementPath=iaas/v2beta1api/NexthopIPv6.java -iaasV2betaRoutNexthopIPv6.hash=69421ea20ef9d68892a965c3914547fe +iaasV2betaRouteNexthopIPv6.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java +iaasV2betaRouteNexthopIPv6.replacementPath=iaas/v2beta1api/NexthopIPv6.java +iaasV2betaRouteNexthopIPv6.hash=ec029362fe0f289ce8732183cacc6855 -iaasV2betaRoutNexthopBlackhole.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java -iaasV2betaRoutNexthopBlackhole.replacementPath=iaas/v2beta1api/NexthopBlackhole.java -iaasV2betaRoutNexthopBlackhole.hash=eaab6cd1a5e3c2edf429534565b018a6 +iaasV2betaRouteNexthopBlackhole.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java +iaasV2betaRouteNexthopBlackhole.replacementPath=iaas/v2beta1api/NexthopBlackhole.java +iaasV2betaRouteNexthopBlackhole.hash=70789628d5bebe2dced654f2833e028d -iaasV2betaRoutNexthopInternet.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java -iaasV2betaRoutNexthopInternet.replacementPath=iaas/v2beta1api/NexthopInternet.java -iaasV2betaRoutNexthopInternet.hash=fd3f5a71d16855c721c0bb5852550538 +iaasV2betaRouteNexthopInternet.path=iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java +iaasV2betaRouteNexthopInternet.replacementPath=iaas/v2beta1api/NexthopInternet.java +iaasV2betaRouteNexthopInternet.hash=ae56426056a1f33dee92236808bf4b90