AnalysisSetPriorityFilesParams.fromJson constructor

AnalysisSetPriorityFilesParams.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json, {
  4. ClientUriConverter? clientUriConverter,
})

Implementation

factory AnalysisSetPriorityFilesParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json,
    {ClientUriConverter? clientUriConverter}) {
  json ??= {};
  if (json is Map) {
    List<String> files;
    if (json.containsKey('files')) {
      files = jsonDecoder.decodeList(
          '$jsonPath.files',
          json['files'],
          (String jsonPath, Object? json) =>
              clientUriConverter?.fromClientFilePath(
                  jsonDecoder.decodeString(jsonPath, json)) ??
              jsonDecoder.decodeString(jsonPath, json));
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'files');
    }
    return AnalysisSetPriorityFilesParams(files);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'analysis.setPriorityFiles params', json);
  }
}