CockpitTestEvidenceIndexEntry.fromJson constructor

CockpitTestEvidenceIndexEntry.fromJson(
  1. Object? value, {
  2. String path = r'$',
})

Decodes a CockpitTestEvidenceIndexEntry from a JSON object.

Implementation

factory CockpitTestEvidenceIndexEntry.fromJson(
  Object? value, {
  String path = r'$',
}) {
  final json = CockpitTestValueReader.object(value, path);
  CockpitTestValueReader.keys(
    json,
    const <String>{'stepResultIndex', 'stepExecutionId', 'artifactIds'},
    path,
    required: const <String>{
      'stepResultIndex',
      'stepExecutionId',
      'artifactIds',
    },
  );
  return CockpitTestEvidenceIndexEntry(
    stepResultIndex: CockpitTestValueReader.integer(
      json['stepResultIndex'],
      '$path.stepResultIndex',
      minimum: 0,
    ),
    stepExecutionId: CockpitTestValueReader.string(
      json['stepExecutionId'],
      '$path.stepExecutionId',
    ),
    artifactIds: CockpitTestValueReader.strings(
      json['artifactIds'],
      '$path.artifactIds',
      id: true,
      unique: true,
    ),
  );
}