PreservedState.fromJson constructor
PreservedState.fromJson(
- Object? j
Implementation
factory PreservedState.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return PreservedState(
disks: switch (json['disks']) {
null => {},
Map<String, Object?> $1 => {
for (final e in $1.entries)
decodeString(e.key): PreservedStatePreservedDisk.fromJson(e.value),
},
_ => throw const FormatException('"disks" is not an object'),
},
externalIPs: switch (json['externalIPs']) {
null => {},
Map<String, Object?> $1 => {
for (final e in $1.entries)
decodeString(e.key): PreservedStatePreservedNetworkIp.fromJson(
e.value,
),
},
_ => throw const FormatException('"externalIPs" is not an object'),
},
internalIPs: switch (json['internalIPs']) {
null => {},
Map<String, Object?> $1 => {
for (final e in $1.entries)
decodeString(e.key): PreservedStatePreservedNetworkIp.fromJson(
e.value,
),
},
_ => throw const FormatException('"internalIPs" is not an object'),
},
metadata: switch (json['metadata']) {
null => {},
Map<String, Object?> $1 => {
for (final e in $1.entries)
decodeString(e.key): decodeString(e.value),
},
_ => throw const FormatException('"metadata" is not an object'),
},
);
}