RouterStatusBgpPeerStatus.fromJson constructor
RouterStatusBgpPeerStatus.fromJson(
- Object? j
Implementation
factory RouterStatusBgpPeerStatus.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return RouterStatusBgpPeerStatus(
advertisedRoutes: switch (json['advertisedRoutes']) {
null => [],
List<Object?> $1 => [for (final i in $1) Route.fromJson(i)],
_ => throw const FormatException('"advertisedRoutes" is not a list'),
},
bfdStatus: switch (json['bfdStatus']) {
null => null,
Object $1 => BfdStatus.fromJson($1),
},
enableIpv4: switch (json['enableIpv4']) {
null => null,
Object $1 => decodeBool($1),
},
enableIpv6: switch (json['enableIpv6']) {
null => null,
Object $1 => decodeBool($1),
},
ipAddress: switch (json['ipAddress']) {
null => null,
Object $1 => decodeString($1),
},
ipv4NexthopAddress: switch (json['ipv4NexthopAddress']) {
null => null,
Object $1 => decodeString($1),
},
ipv6NexthopAddress: switch (json['ipv6NexthopAddress']) {
null => null,
Object $1 => decodeString($1),
},
linkedVpnTunnel: switch (json['linkedVpnTunnel']) {
null => null,
Object $1 => decodeString($1),
},
md5AuthEnabled: switch (json['md5AuthEnabled']) {
null => null,
Object $1 => decodeBool($1),
},
name: switch (json['name']) {
null => null,
Object $1 => decodeString($1),
},
numLearnedRoutes: switch (json['numLearnedRoutes']) {
null => null,
Object $1 => decodeInt($1),
},
peerIpAddress: switch (json['peerIpAddress']) {
null => null,
Object $1 => decodeString($1),
},
peerIpv4NexthopAddress: switch (json['peerIpv4NexthopAddress']) {
null => null,
Object $1 => decodeString($1),
},
peerIpv6NexthopAddress: switch (json['peerIpv6NexthopAddress']) {
null => null,
Object $1 => decodeString($1),
},
routerApplianceInstance: switch (json['routerApplianceInstance']) {
null => null,
Object $1 => decodeString($1),
},
state: switch (json['state']) {
null => null,
Object $1 => decodeString($1),
},
status: switch (json['status']) {
null => null,
Object $1 => decodeString($1),
},
statusReason: switch (json['statusReason']) {
null => null,
Object $1 => decodeString($1),
},
uptime: switch (json['uptime']) {
null => null,
Object $1 => decodeString($1),
},
uptimeSeconds: switch (json['uptimeSeconds']) {
null => null,
Object $1 => decodeString($1),
},
);
}