CockpitOperationInvocation.fromJson constructor
Decodes a CockpitOperationInvocation from a JSON object.
Implementation
factory CockpitOperationInvocation.fromJson(
Object? value, {
String path = r'$',
}) {
final json = CockpitFoundationValueReader.object(value, path);
CockpitFoundationValueReader.keys(
json,
const <String>{
'kind',
'input',
'rootId',
'workspaceId',
'idempotencyKey',
'deadline',
'requiredFeatures',
},
path,
required: const <String>{'kind', 'input', 'requiredFeatures'},
);
return CockpitOperationInvocation(
kind: CockpitFoundationValueReader.kind(json['kind'], '$path.kind'),
input: CockpitFoundationValueReader.jsonObject(
json['input'],
'$path.input',
),
rootId: json['rootId'] == null
? null
: CockpitFoundationValueReader.id(json['rootId'], '$path.rootId'),
workspaceId: json['workspaceId'] == null
? null
: CockpitFoundationValueReader.id(
json['workspaceId'],
'$path.workspaceId',
),
idempotencyKey: json['idempotencyKey'] == null
? null
: CockpitIdempotencyKey.fromJson(
json['idempotencyKey'],
path: '$path.idempotencyKey',
),
deadline: json['deadline'] == null
? null
: CockpitFoundationValueReader.dateTime(
json['deadline'],
'$path.deadline',
),
requiredFeatures: CockpitFoundationValueReader.ids(
json['requiredFeatures'],
'$path.requiredFeatures',
),
);
}