fromJson static method
Implementation
static CockpitCaseSubmissionSource fromJson(
Object? value, {
String path = r'$',
}) {
final json = CockpitFoundationValueReader.object(value, path);
final kind = CockpitFoundationValueReader.string(
json['kind'],
'$path.kind',
);
return switch (kind) {
'inline' => CockpitInlineCaseSource.fromJson(value, path: path),
'indexed' => CockpitIndexedCaseSource.fromJson(value, path: path),
_ => throw FormatException('Unsupported case source kind at $path.kind.'),
};
}