CockpitTestCallOperationTemplate.fromJson constructor

CockpitTestCallOperationTemplate.fromJson(
  1. Object? value, {
  2. required String path,
})

Decodes a CockpitTestCallOperationTemplate from a JSON object.

Implementation

factory CockpitTestCallOperationTemplate.fromJson(
  Object? value, {
  required String path,
}) {
  final json = CockpitTestValueReader.object(value, path);
  CockpitTestValueReader.keys(
    json,
    const <String>{'fragment'},
    path,
    required: const <String>{'fragment'},
  );
  return CockpitTestCallOperationTemplate(
    CockpitTestValueReader.string(
      json['fragment'],
      '$path.fragment',
      id: true,
    ),
  );
}