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) {
    throw jsonDecoder.mismatch(jsonPath, "'edit.getAssists result'", json);
  }
  List<PrioritizedSourceChange> assists;
  if (json case {'assists': var encodedAssists}) {
    assists = jsonDecoder.decodeList(
      '$jsonPath.assists',
      encodedAssists,
      (String jsonPath, Object? json) => PrioritizedSourceChange.fromJson(
        jsonDecoder,
        jsonPath,
        json,
        clientUriConverter: clientUriConverter,
      ),
    );
  } else {
    throw jsonDecoder.mismatch(jsonPath, "'assists'", json);
  }
  return EditGetAssistsResult(assists);
}