RouterBgp.fromJson constructor
RouterBgp.fromJson(
- Object? j
Implementation
factory RouterBgp.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return RouterBgp(
advertiseMode: switch (json['advertiseMode']) {
null => null,
Object $1 => decodeString($1),
},
advertisedGroups: switch (json['advertisedGroups']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"advertisedGroups" is not a list'),
},
advertisedIpRanges: switch (json['advertisedIpRanges']) {
null => [],
List<Object?> $1 => [
for (final i in $1) RouterAdvertisedIpRange.fromJson(i),
],
_ => throw const FormatException('"advertisedIpRanges" is not a list'),
},
asn: switch (json['asn']) {
null => null,
Object $1 => decodeInt($1),
},
identifierRange: switch (json['identifierRange']) {
null => null,
Object $1 => decodeString($1),
},
keepaliveInterval: switch (json['keepaliveInterval']) {
null => null,
Object $1 => decodeInt($1),
},
);
}