ContainerSpec.fromJson constructor
ContainerSpec.fromJson(
- Object? j
Implementation
factory ContainerSpec.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return ContainerSpec(
imageUri: switch (json['imageUri']) {
null => '',
Object $1 => decodeString($1),
},
command: switch (json['command']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"command" is not a list'),
},
args: switch (json['args']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"args" is not a list'),
},
env: switch (json['env']) {
null => [],
List<Object?> $1 => [for (final i in $1) EnvVar.fromJson(i)],
_ => throw const FormatException('"env" is not a list'),
},
);
}