EditBulkFixesParams.fromJson constructor

EditBulkFixesParams.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json
)

Implementation

factory EditBulkFixesParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    List<String> included;
    if (json.containsKey('included')) {
      included = jsonDecoder.decodeList(
          '$jsonPath.included', json['included'], jsonDecoder.decodeString);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'included');
    }
    bool? inTestMode;
    if (json.containsKey('inTestMode')) {
      inTestMode =
          jsonDecoder.decodeBool('$jsonPath.inTestMode', json['inTestMode']);
    }
    List<String>? codes;
    if (json.containsKey('codes')) {
      codes = jsonDecoder.decodeList(
          '$jsonPath.codes', json['codes'], jsonDecoder.decodeString);
    }
    return EditBulkFixesParams(included,
        inTestMode: inTestMode, codes: codes);
  } else {
    throw jsonDecoder.mismatch(jsonPath, 'edit.bulkFixes params', json);
  }
}