CockpitWorkspaceMarker.fromJson constructor
Decodes a CockpitWorkspaceMarker from a JSON object.
Implementation
factory CockpitWorkspaceMarker.fromJson(Object? value, {String path = r'$'}) {
final json = CockpitFoundationValueReader.object(value, path);
const fields = <String>{
'schemaVersion',
'workspaceId',
'projectId',
'checkoutId',
'createdAt',
};
CockpitFoundationValueReader.keys(json, fields, path, required: fields);
return CockpitWorkspaceMarker(
schemaVersion: CockpitFoundationValueReader.string(
json['schemaVersion'],
'$path.schemaVersion',
),
workspaceId: CockpitFoundationValueReader.id(
json['workspaceId'],
'$path.workspaceId',
),
projectId: CockpitFoundationValueReader.id(
json['projectId'],
'$path.projectId',
),
checkoutId: CockpitFoundationValueReader.id(
json['checkoutId'],
'$path.checkoutId',
),
createdAt: CockpitFoundationValueReader.dateTime(
json['createdAt'],
'$path.createdAt',
),
);
}