EditGetAssistsResult.fromJson constructor

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

Implementation

factory EditGetAssistsResult.fromJson(
  JsonDecoder jsonDecoder,
  String jsonPath,
  Object? json, {
  ClientUriConverter? clientUriConverter,
}) {
  json ??= {};
  if (json is Map) {
    List<PrioritizedSourceChange> assists;
    if (json.containsKey('assists')) {
      assists = jsonDecoder.decodeList(
        '$jsonPath.assists',
        json['assists'],
        (String jsonPath, Object? json) => PrioritizedSourceChange.fromJson(
          jsonDecoder,
          jsonPath,
          json,
          clientUriConverter: clientUriConverter,
        ),
      );
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'assists');
    }
    return EditGetAssistsResult(assists);
  } else {
    throw jsonDecoder.mismatch(jsonPath, 'edit.getAssists result', json);
  }
}