Skip to content
Merged
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 @@ -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<TypeEnum> {
@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)
Expand All @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TypeEnum> {
@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)
Expand All @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TypeEnum> {
@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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TypeEnum> {
@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)
Expand All @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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()));
}
Expand Down
Loading
Loading